diff options
Diffstat (limited to 'instruments/models.py')
-rw-r--r-- | instruments/models.py | 27 |
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)"), |