summaryrefslogtreecommitdiffstats
path: root/instruments/models.py
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-10-14 16:43:17 +0100
committerMatthew Lemon <y@yulqen.org>2024-10-14 16:43:17 +0100
commitcb9f0fad4140c9cfff63f056f88da1b8bdb2f9cc (patch)
tree8d88ffe146efffe47e22d1a79ef5757621c9aa38 /instruments/models.py
parent41cf37ac30e2efac6427a4f126954a442579bc41 (diff)
Adds basic SOP model and adds it to admin
Diffstat (limited to 'instruments/models.py')
-rw-r--r--instruments/models.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/instruments/models.py b/instruments/models.py
index 9415957..3e6fa1d 100644
--- a/instruments/models.py
+++ b/instruments/models.py
@@ -1,6 +1,7 @@
from django.db import models
from engagements.models import EngagementEffort, Organisation
+from myuser.models import TeamUser
class Common(models.Model):
@@ -11,8 +12,33 @@ class Common(models.Model):
abstract = True
+class SOP(Common):
+ draft_status = [
+ ("Draft", "Draft"),
+ ("Final", "Final"),
+ ("Published", "Published"),
+ ("To be reviewed", "To be reviewed"),
+ ]
+ name = models.CharField(max_length=512, null=False, blank=False)
+ designation = models.CharField(max_length=5, null=False, blank=False)
+ # sp_link is for Sharepoint so the max length has to be massive
+ sp_link = models.URLField(max_length=1000, null=True, blank=True)
+ draft_status = models.CharField(max_length=20, choices=draft_status, null=False, blank=False)
+ author_lead = models.ForeignKey(
+ TeamUser,
+ on_delete=models.CASCADE,
+ )
+
+ def __str__(self):
+ return self.name
+
+ class Meta:
+ verbose_name = "SOP"
+
+
class Instrument(Common):
"JSP 628, JSP 440, the ONR ones, etc"
+
name = models.CharField(max_length=512, null=False, blank=False)
long_title = models.CharField(max_length=1024, null=True, blank=True)
designator = models.CharField(max_length=3, null=True, blank=True)
@@ -28,6 +54,7 @@ class Instrument(Common):
class SubInstrument(Common):
"DSCs, Chapters, Supplements, Leaflets..."
+
choices = (
("DSC", "Defence Security Condition (DSC)"),
("DSYAP", "Defence Security Assessment Principle (DSyAP)"),