diff options
Diffstat (limited to 'ctrack/organisations')
-rw-r--r-- | ctrack/organisations/migrations/0003_organisation_address.py | 19 | ||||
-rw-r--r-- | ctrack/organisations/models.py | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/ctrack/organisations/migrations/0003_organisation_address.py b/ctrack/organisations/migrations/0003_organisation_address.py new file mode 100644 index 0000000..6437d29 --- /dev/null +++ b/ctrack/organisations/migrations/0003_organisation_address.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.9 on 2020-01-21 10:06 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('organisations', '0002_address'), + ] + + operations = [ + migrations.AddField( + model_name='organisation', + name='address', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='organisations.Address'), + ), + ] diff --git a/ctrack/organisations/models.py b/ctrack/organisations/models.py index 01127cc..3ef794c 100644 --- a/ctrack/organisations/models.py +++ b/ctrack/organisations/models.py @@ -18,6 +18,7 @@ class Address(models.Model): class Organisation(models.Model): name = models.CharField(max_length=255, blank=False) + address = models.ForeignKey(Address, on_delete=models.CASCADE, blank=True, null=True) def get_absolute_url(self): return reverse("organisations:detail", kwargs={"name": self.slugify_name()}) |