Commit 4d310990 authored by Nicolas Joyard's avatar Nicolas Joyard

Fix non-unique natural key

parent 4e1f1011
......@@ -76,7 +76,7 @@
"representative_name": "",
"position": "for",
"proposal": [
"http://www.assemblee-nationale.fr/scrutins/detail/(legislature)/14/(num)/740",
"La motion de rejet pr\u00e9alable, pr\u00e9sent\u00e9e par m. le roux, de la proposition de loi permettant le libre choix des maires concernant les rythmes scolaires dans l'enseignement du premier degr\u00e9.",
"14/liberte_maires_rythmes_scolaires_premier_degre"
],
"representative": [
......@@ -91,7 +91,7 @@
"representative_name": "",
"position": "against",
"proposal": [
"http://www.assemblee-nationale.fr/scrutins/detail/(legislature)/14/(num)/740-2",
"La motion de rejet pr\u00e9alable, pr\u00e9sent\u00e9e par m. le roux, de la proposition de loi permettant le libre choix des maires concernant les rythmes scolaires dans l'enseignement du premier degr\u00e9. (1)",
"14/liberte_maires_rythmes_scolaires_premier_degre"
],
"representative": [
......@@ -106,7 +106,7 @@
"representative_name": "",
"position": "abstain",
"proposal": [
"http://www.assemblee-nationale.fr/scrutins/detail/(legislature)/14/(num)/748",
"L'amendement n\u00b0 381 de m. dolez \u00e0 l'article 2 du projet de loi de modernisation de l'action publique territoriale et d'affirmation des m\u00e9tropoles.",
"14/action_publique_territoriale_metropoles"
],
"representative": [
......
......@@ -4,7 +4,7 @@
"representative_name": "",
"position": "abstain",
"proposal": [
"A7-0234/2012",
"A7-0234/2012 - Charles Goerens - \u00a7 31",
"2012/2002(INI)"
],
"representative": [
......@@ -19,7 +19,7 @@
"representative_name": "",
"position": "abstain",
"proposal": [
"A7-0234/2012",
"A7-0234/2012 - Charles Goerens - \u00a7 31",
"2012/2002(INI)"
],
"representative": [
......@@ -34,7 +34,7 @@
"representative_name": "",
"position": "for",
"proposal": [
"A7-0234/2012",
"A7-0234/2012 - Charles Goerens - R\u00e9solution",
"2012/2002(INI)"
],
"representative": [
......@@ -49,7 +49,7 @@
"representative_name": "",
"position": "for",
"proposal": [
"A7-0234/2012",
"A7-0234/2012 - Charles Goerens - R\u00e9solution",
"2012/2002(INI)"
],
"representative": [
......@@ -64,7 +64,7 @@
"representative_name": "",
"position": "against",
"proposal": [
"A8-0298/2015",
"A8-0298/2015 - Jos\u00e9 Manuel Fernandes et G\u00e9rard Deprez - Am 4",
"2015/2132(BUD)"
],
"representative": [
......@@ -79,7 +79,7 @@
"representative_name": "",
"position": "against",
"proposal": [
"A8-0298/2015",
"A8-0298/2015 - Jos\u00e9 Manuel Fernandes et G\u00e9rard Deprez - Am 4",
"2015/2132(BUD)"
],
"representative": [
......@@ -94,7 +94,7 @@
"representative_name": "",
"position": "for",
"proposal": [
"A8-0298/2015",
"A8-0298/2015 - Jos\u00e9 Manuel Fernandes et G\u00e9rard Deprez - Am 29",
"2015/2132(BUD)"
],
"representative": [
......@@ -109,7 +109,7 @@
"representative_name": "",
"position": "against",
"proposal": [
"A8-0298/2015",
"A8-0298/2015 - Jos\u00e9 Manuel Fernandes et G\u00e9rard Deprez - Am 29",
"2015/2132(BUD)"
],
"representative": [
......@@ -124,7 +124,7 @@
"representative_name": "",
"position": "abstain",
"proposal": [
"A8-0298/2015",
"A8-0298/2015 - Jos\u00e9 Manuel Fernandes et G\u00e9rard Deprez - Am 31",
"2015/2132(BUD)"
],
"representative": [
......@@ -139,7 +139,7 @@
"representative_name": "",
"position": "against",
"proposal": [
"A8-0298/2015",
"A8-0298/2015 - Jos\u00e9 Manuel Fernandes et G\u00e9rard Deprez - Am 31",
"2015/2132(BUD)"
],
"representative": [
......@@ -154,7 +154,7 @@
"representative_name": "",
"position": "for",
"proposal": [
"A8-0298/2015",
"A8-0298/2015 - Jos\u00e9 Manuel Fernandes et G\u00e9rard Deprez - Am 30",
"2015/2132(BUD)"
],
"representative": [
......
......@@ -45,9 +45,9 @@ class Document(TimeStampedModel):
class ProposalManager(models.Manager):
def get_by_natural_key(self, reference, dossier_nk):
def get_by_natural_key(self, title, dossier_nk):
dossier = Dossier.objects.get_by_natural_key(dossier_nk)
return self.get(reference=reference, dossier=dossier)
return self.get(title=title, dossier=dossier)
class Proposal(TimeStampedModel):
......@@ -84,7 +84,7 @@ class Proposal(TimeStampedModel):
return unicode(self.title)
def natural_key(self):
return (self.reference,) + self.dossier.natural_key()
return (self.title,) + self.dossier.natural_key()
class Vote(models.Model):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment