Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
django-menu-generator-ng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
AlekSIS®
Libraries
django-menu-generator-ng
Commits
26377972
Commit
26377972
authored
4 years ago
by
Milton Lenis
Browse files
Options
Downloads
Patches
Plain Diff
Added Travis versions and fixed flake8 errors
parent
810f4179
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.travis.yml
+7
-3
7 additions, 3 deletions
.travis.yml
README.rst
+2
-2
2 additions, 2 deletions
README.rst
menu_generator/tests/test_menu.py
+3
-3
3 additions, 3 deletions
menu_generator/tests/test_menu.py
menu_generator/utils.py
+2
-1
2 additions, 1 deletion
menu_generator/utils.py
with
14 additions
and
9 deletions
.travis.yml
+
7
−
3
View file @
26377972
...
...
@@ -8,11 +8,15 @@ python:
-
"
3.4"
env
:
-
DJANGO="django==1.11.9"
-
DJANGO="django==3.1.3"
-
DJANGO="django==3.0.11"
-
DJANGO="django==2.2.17"
-
DJANGO="django==2.1.15"
-
DJANGO="django==2.0.13"
-
DJANGO="django==1.11.29"
-
DJANGO="django==1.10.8"
-
DJANGO="django==1.9.13"
-
DJANGO="django==1.8.18"
-
DJANGO="django==2.0.1"
-
DJANGO="django==1.8.19"
install
:
-
pip install $DJANGO
...
...
This diff is collapsed.
Click to expand it.
README.rst
+
2
−
2
View file @
26377972
...
...
@@ -13,8 +13,8 @@ dictionaries to generate menu items
Features:
---------
- Tested support to Python 3.4, 3.5, 3.6
- Tested support to Django 1.8, 1.9, 1.10, 1.11, 2.0
- Tested support to Python 3.4, 3.5, 3.6
, 3.7, 3.8
- Tested support to Django 1.8, 1.9, 1.10, 1.11, 2.0
, 2.2, 3.0, 3.1
- No database
- Support unlimited menus
- Icons support
...
...
This diff is collapsed.
Click to expand it.
menu_generator/tests/test_menu.py
+
3
−
3
View file @
26377972
...
...
@@ -267,7 +267,7 @@ class MenuTestCase(TestCase):
self
.
request
.
path
=
"
/persons/1/
"
self
.
menu
.
save_user_state
(
self
.
request
)
list_dict
=
[
{
{
"
name
"
:
"
parent1
"
,
"
url
"
:
"
/user/account/
"
,
"
related_urls
"
:
[
"
/persons/
"
,
"
/groups/
"
],
...
...
@@ -283,7 +283,7 @@ class MenuTestCase(TestCase):
self
.
request
.
path
=
"
/persons/1/
"
self
.
menu
.
save_user_state
(
self
.
request
)
list_dict
=
[
{
{
"
name
"
:
"
parent1
"
,
"
url
"
:
"
/user/account/
"
,
"
submenu
"
:
[
...
...
@@ -305,4 +305,4 @@ class MenuTestCase(TestCase):
self
.
assertEqual
(
len
(
nav
),
1
)
self
.
assertEqual
(
nav
[
0
][
"
selected
"
],
True
)
self
.
assertEqual
(
nav
[
0
][
"
submenu
"
][
0
][
"
selected
"
],
True
)
self
.
assertEqual
(
nav
[
0
][
"
submenu
"
][
1
][
"
selected
"
],
False
)
\ No newline at end of file
self
.
assertEqual
(
nav
[
0
][
"
submenu
"
][
1
][
"
selected
"
],
False
)
This diff is collapsed.
Click to expand it.
menu_generator/utils.py
+
2
−
1
View file @
26377972
...
...
@@ -9,6 +9,7 @@ if django.VERSION >= (1, 10): # pragma: no cover
else
:
from
django.core.urlresolvers
import
reverse
,
NoReverseMatch
def
get_callable
(
func_or_path
):
"""
Receives a dotted path or a callable, Returns a callable or None
...
...
@@ -50,4 +51,4 @@ def parse_url(url):
final_url
=
reverse
(
**
url
)
if
type
(
url
)
is
dict
else
reverse
(
url
)
except
NoReverseMatch
:
final_url
=
url
return
final_url
\ No newline at end of file
return
final_url
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment