Skip to content
Extraits de code Groupes Projets
Valider 69c6d0b2 rédigé par Jamesie Pic's avatar Jamesie Pic
Parcourir les fichiers

Country removal command update

parent f456a018
Branches
Étiquettes
Aucune requête de fusion associée trouvée
......@@ -5,4 +5,4 @@ from representatives.models import Country
class Command(RemoveCommand):
manager = Country.objects
conditions = {'groups': None}
conditions = {'constituencies': None}
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('representatives', '0012_index_group_name'),
]
operations = [
migrations.AlterField(
model_name='constituency',
name='country',
field=models.ForeignKey(related_name='constituencies', blank=True, to='representatives.Country', null=True),
),
]
......@@ -189,7 +189,8 @@ class Constituency(HashableModel, TimeStampedModel):
An authority for which a representative has a mandate
"""
name = models.CharField(max_length=255)
country = models.ForeignKey('Country', null=True, blank=True)
country = models.ForeignKey('Country', null=True, blank=True,
related_name='constituencies')
hashable_fields = ['name']
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter