Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Political Memory
memopol
Commits
b6432187
Commit
b6432187
authored
Aug 06, 2016
by
Nicolas Joyard
Browse files
Add theme list and detail pages
parent
772b90c5
Changes
47
Hide whitespace changes
Inline
Side-by-side
memopol/filters.py
View file @
b6432187
...
...
@@ -11,6 +11,7 @@ from django_filters import FilterSet, MethodFilter, ModelChoiceFilter
from
representatives.models
import
Chamber
,
Group
,
Representative
from
representatives_votes.models
import
Dossier
from
memopol_themes.models
import
Theme
def
rep_chamber_filter
(
qs
,
value
):
...
...
@@ -77,3 +78,19 @@ class DossierFilter(FilterSet):
return
qs
.
filter
(
Q
(
title__icontains
=
value
)
|
Q
(
reference__icontains
=
value
))
class
ThemeFilter
(
FilterSet
):
search
=
MethodFilter
(
action
=
'search_filter'
)
class
Meta
:
model
=
Theme
fields
=
[
'search'
]
def
search_filter
(
self
,
qs
,
value
):
if
len
(
value
)
==
0
:
return
qs
return
qs
.
filter
(
Q
(
name__icontains
=
value
)
|
Q
(
description__icontains
=
value
))
memopol/fixtures/smaller_sample.json
View file @
b6432187
...
...
@@ -23200,5 +23200,32 @@
},
"model": "representatives_recommendations.recommendation",
"pk": 47
},
{
"fields": {
"description": "The Anti-Counterfeiting Trade agreement is a really bad thing, we would like to kill it with fire.",
"positions": [
],
"proposals": [
5744, 5745, 5746
],
"dossiers": [
28147
],
"slug": "acta",
"name": "acta"
},
"model": "memopol_themes.theme",
"pk": 1
},
{
"fields": {
"theme": 1,
"datetime": "2008-01-01",
"link": "http://www.laquadrature.net",
"title": "Press release on ACTA from La Quadrature du Net"
},
"model": "memopol_themes.themelink",
"pk": 1
}
]
memopol/tests/response_fixtures/DossiersTest.test_dossier_detail.content
View file @
b6432187
...
...
@@ -65,6 +65,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/DossiersTest.test_dossier_list.content
View file @
b6432187
...
...
@@ -69,6 +69,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/DossiersTest.test_dossier_search.content
View file @
b6432187
...
...
@@ -69,6 +69,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/DossiersTest.test_dossier_search_noresults.content
View file @
b6432187
...
...
@@ -69,6 +69,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/DossiersTest.test_dossier_sorting.content
View file @
b6432187
...
...
@@ -69,6 +69,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/GroupListTest.test_active_committees.content
View file @
b6432187
...
...
@@ -65,6 +65,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/GroupListTest.test_active_delegations.content
View file @
b6432187
...
...
@@ -65,6 +65,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/GroupListTest.test_active_parties.content
View file @
b6432187
...
...
@@ -65,6 +65,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/GroupListTest.test_all_committees.content
View file @
b6432187
...
...
@@ -65,6 +65,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/GroupListTest.test_all_delegations.content
View file @
b6432187
...
...
@@ -65,6 +65,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/GroupListTest.test_all_parties.content
View file @
b6432187
...
...
@@ -65,6 +65,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/GroupListTest.test_chambers.content
View file @
b6432187
...
...
@@ -65,6 +65,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/GroupListTest.test_country.content
View file @
b6432187
...
...
@@ -65,6 +65,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/RepresentativeListTest.test_filter_chamber.content
View file @
b6432187
...
...
@@ -74,6 +74,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/RepresentativeListTest.test_filter_country.content
View file @
b6432187
...
...
@@ -74,6 +74,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/RepresentativeListTest.test_filter_group.content
View file @
b6432187
...
...
@@ -74,6 +74,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/RepresentativeListTest.test_filter_multiple.content
View file @
b6432187
...
...
@@ -74,6 +74,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
memopol/tests/response_fixtures/RepresentativeListTest.test_filter_notfound.content
View file @
b6432187
...
...
@@ -74,6 +74,11 @@
Committees
</a>
</li>
<li>
<a
href=
'/theme/'
>
Themes
</a>
</li>
<li>
<a
href=
'/votes/dossier/'
>
Dossiers
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment