Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
memopol
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
32
Issues
32
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Political Memory
memopol
Commits
9e751c93
Commit
9e751c93
authored
Feb 09, 2016
by
Jamesie Pic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exclude votes without recommendation from display
parent
8eac5f5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
memopol/views.py
memopol/views.py
+4
-2
No files found.
memopol/views.py
View file @
9e751c93
...
...
@@ -5,7 +5,7 @@ from core.views import GridListMixin, PaginationMixin, CSVDownloadMixin
from
representatives
import
views
as
representatives_views
from
representatives.models
import
Representative
from
representatives_votes
import
views
as
representatives_votes_views
from
representatives_votes.models
import
Dossier
from
representatives_votes.models
import
Dossier
,
Proposal
from
representatives_positions.forms
import
PositionForm
from
representatives_recommendations.models
import
ScoredVote
...
...
@@ -42,7 +42,9 @@ class RepresentativeDetail(representatives_views.RepresentativeDetail):
def
get_queryset
(
self
):
qs
=
super
(
RepresentativeDetail
,
self
).
get_queryset
()
votes
=
ScoredVote
.
objects
.
select_related
(
'proposal__recommendation'
)
votes
=
ScoredVote
.
objects
.
filter
(
proposal__in
=
Proposal
.
objects
.
exclude
(
recommendation
=
None
),
).
select_related
(
'proposal__recommendation'
)
qs
=
qs
.
prefetch_related
(
models
.
Prefetch
(
'votes'
,
queryset
=
votes
))
return
qs
...
...
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