Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
django-panik-nonstop
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
radiopanik
django-panik-nonstop
Commits
d699e3f1
Commit
d699e3f1
authored
Feb 05, 2018
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add "any" nonstop zone filter
parent
137b0aea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
nonstop/forms.py
nonstop/forms.py
+3
-1
nonstop/views.py
nonstop/views.py
+2
-0
No files found.
nonstop/forms.py
View file @
d699e3f1
...
...
@@ -11,7 +11,9 @@ def get_optional_nonstop_zones():
return
[(
''
,
''
)]
+
get_nonstop_zones
()
def
get_search_nonstop_zones
():
return
[(
''
,
'All'
),
(
''
,
'--------------'
)]
+
get_nonstop_zones
()
+
[(
''
,
'--------------'
),
(
'none'
,
'None'
)]
return
[(
''
,
'All'
),
(
'any'
,
_
(
'Any'
)),
(
''
,
'--------------'
)]
+
get_nonstop_zones
()
+
[(
''
,
'--------------'
),
(
'none'
,
'None'
)]
class
UploadTracksForm
(
forms
.
Form
):
tracks
=
forms
.
FileField
(
widget
=
forms
.
ClearableFileInput
(
...
...
nonstop/views.py
View file @
d699e3f1
...
...
@@ -262,6 +262,8 @@ class SearchView(TemplateView):
from
emissions.models
import
Nonstop
if
zone
==
'none'
:
queryset
=
queryset
.
filter
(
nonstop_zones
=
None
)
elif
zone
==
'any'
:
queryset
=
queryset
.
filter
(
nonstop_zones__isnull
=
False
).
distinct
()
else
:
queryset
=
queryset
.
filter
(
nonstop_zones
=
zone
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment