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
luxcem
memopol
Commits
4085501d
Commit
4085501d
authored
Oct 11, 2016
by
Nicolas Joyard
Browse files
[ci fix] enforce email ordering on csv exports
parent
c061527a
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/memopol/tests/response_fixtures/RepresentativeListTest.test_csv.content
View file @
4085501d
François Asensi,fasensi@assemblee-nationale.fr,GDR,France [FR]
Thierry Benoit,"tbenoit@assemblee-nationale
.fr, contact@thierry-benoit
.fr",UDI,France [FR]
Thierry Benoit,"
contact@thierry-benoit.fr,
tbenoit@assemblee-nationale.fr",UDI,France [FR]
Marcel Bonnot,"marcelbonnot@yahoo.fr, mbonnot@assemblee-nationale.fr",LR,France [FR]
Jean-Claude Bouchet,"jcbouchet@assemblee-nationale.fr, jcbouchet@jcbouchet.fr",LR,France [FR]
Paul BRANNEN,paul.brannen@europarl.europa.eu,SD,United Kingdom [GB]
...
...
@@ -9,7 +9,7 @@ Jean-Louis Christ,"christjl@wanadoo.fr, jlchrist@assemblee-nationale.fr",LR,Fran
Jean-Michel Couve,"couve.jean-michel@wanadoo.fr, jmcouve@assemblee-nationale.fr",LR,France [FR]
Esther de LANGE,esther.delange@europarl.europa.eu,EPP,Netherlands [NL]
Albert DESS,albert.dess@europarl.europa.eu,EPP,Germany [DE]
Marc Dolez,"mdolez@assemblee-nationale.fr
, contact@marc-dolez.org
",GDR,France [FR]
Marc Dolez,"
contact@marc-dolez.org,
mdolez@assemblee-nationale.fr",GDR,France [FR]
Dominique Dord,ddord@assemblee-nationale.fr,LR,France [FR]
Olivier Dussopt,odussopt@assemblee-nationale.fr,SER,France [FR]
Daniel Fasquelle,dfasquelle@assemblee-nationale.fr,LR,France [FR]
...
...
@@ -27,19 +27,19 @@ Werner LANGEN,werner.langen@europarl.europa.eu,EPP,Germany [DE]
Jo LEINEN,jo.leinen@europarl.europa.eu,SD,Germany [DE]
Pierre Lellouche,plellouche@assemblee-nationale.fr,LR,France [FR]
Annick Lepetit,"alepetit@assemblee-nationale.fr, annick-lepetit@wanadoo.fr",SER,France [FR]
Pierre Lequiller,"plequiller@assemblee-nationale.fr
, pierre.lequiller@gmail.com
",LR,France [FR]
Pierre Lequiller,"
pierre.lequiller@gmail.com,
plequiller@assemblee-nationale.fr",LR,France [FR]
Arne LIETZ,arne.lietz@europarl.europa.eu,SD,Germany [DE]
Verónica LOPE FONTAGNÉ,veronica.lopefontagne@europarl.europa.eu,EPP,Spain [ES]
Jacqueline Maquet,"
j-maquet@orange.fr,
jmaquet@assemblee-nationale.fr",SER,France [FR]
Jacqueline Maquet,"jmaquet@assemblee-nationale.fr
, j-maquet@orange.fr
",SER,France [FR]
Philippe Martin,pmartin@assemblee-nationale.fr,SER,France [FR]
Gesine MEISSNER,gesine.meissner@europarl.europa.eu,ALDE,Germany [DE]
Alain Moyne-Bressand,"
moyne-bressand.alain@wanadoo.fr,
amoyne-bressand@assemblee-nationale.fr",LR,France [FR]
Alain Moyne-Bressand,"amoyne-bressand@assemblee-nationale.fr
, moyne-bressand.alain@wanadoo.fr
",LR,France [FR]
Angelika NIEBLER,angelika.niebler@europarl.europa.eu,EPP,Germany [DE]
Paul NUTTALL,paul.nuttall@europarl.europa.eu,EFDD,United Kingdom [GB]
Patrick O'FLYNN,patrick.oflynn@europarl.europa.eu,EFDD,United Kingdom [GB]
Mirosław PIOTROWSKI,miroslaw.piotrowski@europarl.europa.eu,ECR,Poland [PL]
François Pupponi,fpupponi@assemblee-nationale.fr,SER,France [FR]
Jean-Luc Reitzer,"jlr.depute@orange.fr, jlreitzer@assemblee-nationale.fr
, jeanluc.reitzer@wanadoo.fr
",LR,France [FR]
Jean-Luc Reitzer,"
jeanluc.reitzer@wanadoo.fr,
jlr.depute@orange.fr, jlreitzer@assemblee-nationale.fr",LR,France [FR]
Franck Reynier,freynier@assemblee-nationale.fr,UDI,France [FR]
Marcel Rogemont,"marcel.rogemont@wanadoo.fr, mrogemont@assemblee-nationale.fr",SER,France [FR]
André Santini,asantini@assemblee-nationale.fr,UDI,France [FR]
...
...
src/memopol/tests/response_fixtures/RepresentativeListTest.test_order_csv.content
View file @
4085501d
...
...
@@ -7,10 +7,10 @@ Verónica LOPE FONTAGNÉ,veronica.lopefontagne@europarl.europa.eu,EPP,Spain [ES]
Esther de LANGE,esther.delange@europarl.europa.eu,EPP,Netherlands [NL]
Angelika NIEBLER,angelika.niebler@europarl.europa.eu,EPP,Germany [DE]
Mirosław PIOTROWSKI,miroslaw.piotrowski@europarl.europa.eu,ECR,Poland [PL]
Thierry Benoit,"tbenoit@assemblee-nationale
.fr, contact@thierry-benoit
.fr",UDI,France [FR]
Pierre Lequiller,"plequiller@assemblee-nationale.fr
, pierre.lequiller@gmail.com
",LR,France [FR]
Thierry Benoit,"
contact@thierry-benoit.fr,
tbenoit@assemblee-nationale.fr",UDI,France [FR]
Pierre Lequiller,"
pierre.lequiller@gmail.com,
plequiller@assemblee-nationale.fr",LR,France [FR]
Claude Goasguen,cgoasguen@assemblee-nationale.fr,LR,France [FR]
Marc Dolez,"mdolez@assemblee-nationale.fr
, contact@marc-dolez.org
",GDR,France [FR]
Marc Dolez,"
contact@marc-dolez.org,
mdolez@assemblee-nationale.fr",GDR,France [FR]
Pierre Lellouche,plellouche@assemblee-nationale.fr,LR,France [FR]
Philippe Vigier,pvigier@assemblee-nationale.fr,UDI,France [FR]
Marcel Bonnot,"marcelbonnot@yahoo.fr, mbonnot@assemblee-nationale.fr",LR,France [FR]
...
...
@@ -18,7 +18,7 @@ Philippe Houillon,phouillon@assemblee-nationale.fr,LR,France [FR]
Dominique Dord,ddord@assemblee-nationale.fr,LR,France [FR]
Jean-Michel Couve,"couve.jean-michel@wanadoo.fr, jmcouve@assemblee-nationale.fr",LR,France [FR]
Pascale Got,pgot@assemblee-nationale.fr,SER,France [FR]
Alain Moyne-Bressand,"
moyne-bressand.alain@wanadoo.fr,
amoyne-bressand@assemblee-nationale.fr",LR,France [FR]
Alain Moyne-Bressand,"amoyne-bressand@assemblee-nationale.fr
, moyne-bressand.alain@wanadoo.fr
",LR,France [FR]
Jean-Louis Christ,"christjl@wanadoo.fr, jlchrist@assemblee-nationale.fr",LR,France [FR]
Olivier Dussopt,odussopt@assemblee-nationale.fr,SER,France [FR]
Jean-Claude Bouchet,"jcbouchet@assemblee-nationale.fr, jcbouchet@jcbouchet.fr",LR,France [FR]
...
...
@@ -28,9 +28,9 @@ Franck Reynier,freynier@assemblee-nationale.fr,UDI,France [FR]
Marcel Rogemont,"marcel.rogemont@wanadoo.fr, mrogemont@assemblee-nationale.fr",SER,France [FR]
François Pupponi,fpupponi@assemblee-nationale.fr,SER,France [FR]
Philippe Martin,pmartin@assemblee-nationale.fr,SER,France [FR]
Jacqueline Maquet,"
j-maquet@orange.fr,
jmaquet@assemblee-nationale.fr",SER,France [FR]
Jacqueline Maquet,"jmaquet@assemblee-nationale.fr
, j-maquet@orange.fr
",SER,France [FR]
Annick Lepetit,"alepetit@assemblee-nationale.fr, annick-lepetit@wanadoo.fr",SER,France [FR]
Jean-Luc Reitzer,"jlr.depute@orange.fr, jlreitzer@assemblee-nationale.fr
, jeanluc.reitzer@wanadoo.fr
",LR,France [FR]
Jean-Luc Reitzer,"
jeanluc.reitzer@wanadoo.fr,
jlr.depute@orange.fr, jlreitzer@assemblee-nationale.fr",LR,France [FR]
Czesław HOC,czeslaw.hoc@europarl.europa.eu,ECR,Poland [PL]
Dietmar KÖSTER,dietmar.koester@europarl.europa.eu,SD,Germany [DE]
Patrick O'FLYNN,patrick.oflynn@europarl.europa.eu,EFDD,United Kingdom [GB]
...
...
src/memopol/tests/response_fixtures/RepresentativeListTest.test_search_csv.content
View file @
4085501d
Marcel Bonnot,"marcelbonnot@yahoo.fr, mbonnot@assemblee-nationale.fr",LR,France [FR]
Udo BULLMANN,udo.bullmann@europarl.europa.eu,SD,Germany [DE]
Marc Dolez,"mdolez@assemblee-nationale.fr
, contact@marc-dolez.org
",GDR,France [FR]
Marc Dolez,"
contact@marc-dolez.org,
mdolez@assemblee-nationale.fr",GDR,France [FR]
María Teresa GIMÉNEZ BARBAT,teresa.gimenezbarbat@europarl.europa.eu,ALDE,Ireland [IE]
Sylvia-Yvonne KAUFMANN,sylvia-yvonne.kaufmann@europarl.europa.eu,SD,Germany [DE]
Dietmar KÖSTER,dietmar.koester@europarl.europa.eu,SD,Germany [DE]
Jacqueline Maquet,"
j-maquet@orange.fr,
jmaquet@assemblee-nationale.fr",SER,France [FR]
Jacqueline Maquet,"jmaquet@assemblee-nationale.fr
, j-maquet@orange.fr
",SER,France [FR]
Philippe Martin,pmartin@assemblee-nationale.fr,SER,France [FR]
Marcel Rogemont,"marcel.rogemont@wanadoo.fr, mrogemont@assemblee-nationale.fr",SER,France [FR]
Hermann WINKLER,hermann.winkler@europarl.europa.eu,EPP,Germany [DE]
src/memopol/views/representative_list.py
View file @
4085501d
...
...
@@ -3,9 +3,10 @@
from
core.views
import
GridListMixin
,
PaginationMixin
,
CSVDownloadMixin
,
\
ActiveLegislatureMixin
,
SortMixin
from
django.db
import
models
from
django.views
import
generic
from
representatives.models
import
Representative
from
representatives.models
import
Representative
,
Email
from
..filters
import
RepresentativeFilter
from
.representative_mixin
import
RepresentativeViewMixin
...
...
@@ -72,7 +73,12 @@ class RepresentativeList(CSVDownloadMixin, GridListMixin, PaginationMixin,
def
get_csv_results
(
self
,
context
,
**
kwargs
):
qs
=
self
.
get_queryset
()
qs
=
qs
.
prefetch_related
(
'email_set'
)
qs
=
qs
.
prefetch_related
(
models
.
Prefetch
(
'email_set'
,
queryset
=
Email
.
objects
.
order_by
(
'email'
)
)
)
return
[
self
.
add_representative_country_and_main_mandate
(
r
)
for
r
in
qs
]
...
...
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