aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ctrack/organisations/migrations/0015_organisation_designation_type.py18
-rw-r--r--ctrack/organisations/models.py7
2 files changed, 25 insertions, 0 deletions
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})