From e6f21ed32e35ba201402c860ba33429afb4e8716 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 17 Feb 2020 16:50:35 +0000 Subject: added designation field for organisaton --- .../migrations/0015_organisation_designation_type.py | 18 ++++++++++++++++++ ctrack/organisations/models.py | 7 +++++++ 2 files changed, 25 insertions(+) create mode 100644 ctrack/organisations/migrations/0015_organisation_designation_type.py (limited to 'ctrack/organisations') diff --git a/ctrack/organisations/migrations/0015_organisation_designation_type.py b/ctrack/organisations/migrations/0015_organisation_designation_type.py new file mode 100644 index 0000000..50ec8d8 --- /dev/null +++ b/ctrack/organisations/migrations/0015_organisation_designation_type.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.9 on 2020-02-17 16:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('organisations', '0014_auto_20200125_1459'), + ] + + operations = [ + migrations.AddField( + model_name='organisation', + name='designation_type', + field=models.IntegerField(choices=[(1, 'Automatic'), (2, 'Reserve Power')], default=1), + ), + ] diff --git a/ctrack/organisations/models.py b/ctrack/organisations/models.py index f602a35..e61bcb6 100644 --- a/ctrack/organisations/models.py +++ b/ctrack/organisations/models.py @@ -51,9 +51,16 @@ class Submode(models.Model): class Organisation(models.Model): + + DESIGNATION_TYPE = [ + (1, "Automatic"), + (2, "Reserve Power"), + ] + name = models.CharField(max_length=255) slug = AutoSlugField(populate_from=['name']) submode = models.ForeignKey(Submode, on_delete=models.CASCADE, blank=True, null=True) + designation_type = models.IntegerField(choices=DESIGNATION_TYPE, default=1) def get_absolute_url(self): return reverse("organisations:detail", kwargs={"slug": self.slug}) -- cgit v1.2.3