aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/caf
diff options
context:
space:
mode:
Diffstat (limited to 'ctrack/caf')
-rw-r--r--ctrack/caf/admin.py14
-rw-r--r--ctrack/caf/migrations/0002_caf_systems.py18
-rw-r--r--ctrack/caf/models.py3
3 files changed, 33 insertions, 2 deletions
diff --git a/ctrack/caf/admin.py b/ctrack/caf/admin.py
index e633029..f1aa860 100644
--- a/ctrack/caf/admin.py
+++ b/ctrack/caf/admin.py
@@ -1,6 +1,17 @@
from django.contrib import admin
-from .models import CAF, FileStore, DocumentFile, Grading, ApplicableSystem
+from .models import (
+ CAF,
+ FileStore,
+ DocumentFile,
+ Grading,
+ ApplicableSystem,
+ EssentialService,
+)
+
+
+class EssentialServiceAdmin(admin.ModelAdmin):
+ model = EssentialService
class ApplicableSystemListAdmin(admin.ModelAdmin):
@@ -31,6 +42,7 @@ class CAFAdmin(admin.ModelAdmin):
admin.site.register(CAF, CAFAdmin)
+admin.site.register(EssentialService, EssentialServiceAdmin)
admin.site.register(FileStore)
admin.site.register(DocumentFile)
admin.site.register(Grading)
diff --git a/ctrack/caf/migrations/0002_caf_systems.py b/ctrack/caf/migrations/0002_caf_systems.py
new file mode 100644
index 0000000..9e0f76a
--- /dev/null
+++ b/ctrack/caf/migrations/0002_caf_systems.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.12 on 2020-08-27 12:44
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('caf', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='caf',
+ name='systems',
+ field=models.ManyToManyField(to='caf.ApplicableSystem'),
+ ),
+ ]
diff --git a/ctrack/caf/models.py b/ctrack/caf/models.py
index fc56c30..b77cfdb 100644
--- a/ctrack/caf/models.py
+++ b/ctrack/caf/models.py
@@ -89,7 +89,7 @@ class ApplicableSystem(models.Model):
return self.organisation.person_set.filter(primary_nis_contact=True)
def __str__(self):
- return f"{self.organisation.name} | {self.name}"
+ return self.name
objects = ApplicableSystemManager()
@@ -128,6 +128,7 @@ class CAF(models.Model):
triage_review_inspector = models.ForeignKey(
Person, on_delete=models.CASCADE, blank=True, null=True
)
+ systems = models.ManyToManyField(ApplicableSystem)
comments = models.TextField(max_length=1000)
class Meta: