aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/organisations
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-01-21 10:12:56 +0000
committerMatthew Lemon <lemon@matthewlemon.com>2020-01-21 10:12:56 +0000
commit0bfe3454fde753425d37246b73b3eda1b9a756b9 (patch)
tree05d1d6ff7010b01daca45953e82d8f9d65d56571 /ctrack/organisations
parent6d6b1cd9c405c54cc78dc2b7cbe217ba526a9829 (diff)
fixed failing test - first use of faker object
Diffstat (limited to 'ctrack/organisations')
-rw-r--r--ctrack/organisations/migrations/0003_organisation_address.py19
-rw-r--r--ctrack/organisations/models.py1
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()})