diff options
Diffstat (limited to '')
-rw-r--r-- | ctrack/assessments/__init__.py | 0 | ||||
-rw-r--r-- | ctrack/assessments/admin.py | 31 | ||||
-rw-r--r-- | ctrack/assessments/apps.py | 5 | ||||
-rw-r--r-- | ctrack/assessments/migrations/0001_initial.py | 68 | ||||
-rw-r--r-- | ctrack/assessments/migrations/__init__.py | 0 | ||||
-rw-r--r-- | ctrack/assessments/models.py | 68 | ||||
-rw-r--r-- | ctrack/assessments/tests.py | 3 | ||||
-rw-r--r-- | ctrack/assessments/views.py | 3 |
8 files changed, 178 insertions, 0 deletions
diff --git a/ctrack/assessments/__init__.py b/ctrack/assessments/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ctrack/assessments/__init__.py diff --git a/ctrack/assessments/admin.py b/ctrack/assessments/admin.py new file mode 100644 index 0000000..a78dfe0 --- /dev/null +++ b/ctrack/assessments/admin.py @@ -0,0 +1,31 @@ +from django.contrib import admin + +from ctrack.assessments.models import CAFSelfAssessment, CAFObjective, CAFPrinciple, CAFContributingOutcome, \ + CAFSelfAssessmentOutcomeScore + + +class CAFSelfAssessmentAdmin(admin.ModelAdmin): + model = CAFSelfAssessment + + +class CAFObjectiveAdmin(admin.ModelAdmin): + model = CAFObjective + + +class CAFPrincipleAdmin(admin.ModelAdmin): + model = CAFPrinciple + + +class CAFContributingOutcomeAdmin(admin.ModelAdmin): + model = CAFContributingOutcome + + +class CAFSelfAssessmentOutcomeScoreAdmin(admin.ModelAdmin): + model = CAFSelfAssessmentOutcomeScore + + +admin.site.register(CAFSelfAssessment, CAFSelfAssessmentAdmin) +admin.site.register(CAFObjective, CAFObjectiveAdmin) +admin.site.register(CAFPrinciple, CAFPrincipleAdmin) +admin.site.register(CAFContributingOutcome, CAFContributingOutcomeAdmin) +admin.site.register(CAFSelfAssessmentOutcomeScore, CAFSelfAssessmentOutcomeScoreAdmin) diff --git a/ctrack/assessments/apps.py b/ctrack/assessments/apps.py new file mode 100644 index 0000000..ee0fd00 --- /dev/null +++ b/ctrack/assessments/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class AssessmentsConfig(AppConfig): + name = 'ctrack.assessments' diff --git a/ctrack/assessments/migrations/0001_initial.py b/ctrack/assessments/migrations/0001_initial.py new file mode 100644 index 0000000..9943e4b --- /dev/null +++ b/ctrack/assessments/migrations/0001_initial.py @@ -0,0 +1,68 @@ +# Generated by Django 2.2.9 on 2020-03-12 14:57 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('organisations', '0006_organisation_oes'), + ('caf', '0018_remove_caf_owner'), + ] + + operations = [ + migrations.CreateModel( + name='CAFContributingOutcome', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('designation', models.CharField(help_text='e.g. A1.a, B3.c, etc', max_length=5)), + ('descriptor', models.CharField(help_text='e.g. Board Direction', max_length=50)), + ('order_id', models.IntegerField()), + ], + ), + migrations.CreateModel( + name='CAFObjective', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(help_text='e.g. Managing Risk', max_length=20)), + ('description', models.TextField(max_length=500)), + ('order_id', models.IntegerField()), + ], + ), + migrations.CreateModel( + name='CAFSelfAssessment', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('comments', models.TextField(max_length=500)), + ('caf', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='caf.CAF')), + ('completer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organisations.Person')), + ], + ), + migrations.CreateModel( + name='CAFSelfAssessmentOutcomeScore', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('caf_contributing_outcome', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.CAFContributingOutcome')), + ('caf_self_assessment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.CAFSelfAssessment')), + ], + ), + migrations.CreateModel( + name='CAFPrinciple', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('designation', models.CharField(help_text='e.g. A1, B3, etc', max_length=5)), + ('title', models.CharField(max_length=50)), + ('description', models.TextField(max_length=1000)), + ('order_id', models.IntegerField()), + ('caf_objective', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.CAFObjective')), + ], + ), + migrations.AddField( + model_name='cafcontributingoutcome', + name='principle', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.CAFPrinciple'), + ), + ] diff --git a/ctrack/assessments/migrations/__init__.py b/ctrack/assessments/migrations/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ctrack/assessments/migrations/__init__.py diff --git a/ctrack/assessments/models.py b/ctrack/assessments/models.py new file mode 100644 index 0000000..d17ebbd --- /dev/null +++ b/ctrack/assessments/models.py @@ -0,0 +1,68 @@ +from django.db import models + +from ctrack.caf.models import CAF +from ctrack.organisations.models import Person + + +class CAFSelfAssessment(models.Model): + """ + These are carried out by an OES as result in, or are associated with a CAF. + """ + caf = models.ForeignKey(CAF, on_delete=models.CASCADE) + completer = models.ForeignKey(Person, on_delete=models.CASCADE) + comments = models.TextField(max_length=500) + + class Meta: + verbose_name = "CAF Self Assessment" + + +class CAFObjective(models.Model): + """ + One of 4 as set out in the framework... + """ + name = models.CharField(max_length=20, help_text="e.g. Managing Risk") + description = models.TextField(max_length=500) + order_id = models.IntegerField() + + class Meta: + verbose_name = "CAF Objective" + + + +class CAFPrinciple(models.Model): + """ + One of 14 as set out in the framework. + """ + caf_objective = models.ForeignKey(CAFObjective, on_delete=models.CASCADE) + designation = models.CharField(max_length=5, help_text="e.g. A1, B3, etc") + title = models.CharField(max_length=50) + description = models.TextField(max_length=1000) + order_id = models.IntegerField() + + class Meta: + verbose_name = "CAF Principle" + + +class CAFContributingOutcome(models.Model): + """ + One of the 39 as set out in the framework. + """ + designation = models.CharField(max_length=5, help_text="e.g. A1.a, B3.c, etc") + descriptor = models.CharField(max_length=50, help_text="e.g. Board Direction") + principle = models.ForeignKey(CAFPrinciple, on_delete=models.CASCADE) + order_id = models.IntegerField() + + class Meta: + verbose_name = "CAF Contributing Outcome" + + +class CAFSelfAssessmentOutcomeScore(models.Model): + """ + Details the assessment for an Outcome, and the baseline assessment. + Completed by an OES initially, but can be completed by anyone. + """ + caf_self_assessment = models.ForeignKey(CAFSelfAssessment, on_delete=models.CASCADE) + caf_contributing_outcome = models.ForeignKey(CAFContributingOutcome, on_delete=models.CASCADE) + + class Meta: + verbose_name = "CAF Self Assessment Outcome Score" diff --git a/ctrack/assessments/tests.py b/ctrack/assessments/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/ctrack/assessments/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/ctrack/assessments/views.py b/ctrack/assessments/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/ctrack/assessments/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. |