Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
luxcem
memopol
Commits
9c200545
Commit
9c200545
authored
Feb 09, 2017
by
okhin
Browse files
Fixing the PEP8 errors
parent
455eef28
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/representatives/api.py
View file @
9c200545
...
...
@@ -35,6 +35,7 @@ from .models import (
from
.filters
import
(
ActiveMandateQueryFilterBackend
,
ActiveConstituencyFilterBackend
)
class
DefaultWebPagination
(
pagination
.
PageNumberPagination
):
default_web_page_size
=
10
...
...
src/representatives/filters.py
View file @
9c200545
...
...
@@ -33,13 +33,16 @@ class ActiveMandateQueryFilterBackend(BaseFilterBackend):
)).
distinct
()
return
qs
class
ActiveConstituencyFilterBackend
(
BaseFilterBackend
):
"""
A filter which check if a representative is active in a constituency
the parameter used in the query to filter is, by default, active_constituency.
the parameter used in the query to filter is, by default,
active_constituency.
"""
query_param
=
getattr
(
settings
,
'ACTIVE_CONSTITUENCY_PARAM'
,
'active_constituency'
)
query_param
=
getattr
(
settings
,
'ACTIVE_CONSTITUENCY_PARAM'
,
'active_constituency'
)
def
filter_queryset
(
self
,
request
,
queryset
,
view
):
qs
=
queryset
...
...
Write
Preview
Supports
Markdown
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