Commit 69c6d0b2 authored by Jamesie Pic's avatar Jamesie Pic

Country removal command update

parent f456a018
......@@ -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']
......
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