diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-03-17 17:07:11 +0000 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-03-17 17:07:11 +0000 |
commit | 456da293617ebed027ac4a35f4dd853854982b29 (patch) | |
tree | 8f573f49f709d6ae8714761d09cd77bef749f8c5 /ctrack/assessments | |
parent | b315e9569a1609f2144821be7459e80687fe584b (diff) |
adding all the Contributing Outcomes scores for a single CAF in populate script
Diffstat (limited to 'ctrack/assessments')
-rw-r--r-- | ctrack/assessments/migrations/0005_auto_20200317_1643.py | 25 | ||||
-rw-r--r-- | ctrack/assessments/models.py | 11 |
2 files changed, 36 insertions, 0 deletions
diff --git a/ctrack/assessments/migrations/0005_auto_20200317_1643.py b/ctrack/assessments/migrations/0005_auto_20200317_1643.py new file mode 100644 index 0000000..c7af02b --- /dev/null +++ b/ctrack/assessments/migrations/0005_auto_20200317_1643.py @@ -0,0 +1,25 @@ +# Generated by Django 2.2.9 on 2020-03-17 16:43 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('assessments', '0004_auto_20200315_2003'), + ] + + operations = [ + migrations.AddField( + model_name='cafselfassessmentoutcomescore', + name='baseline_assessment_score', + field=models.CharField(choices=[('Achieved', 'Achieved'), ('Partially Achieved', 'Partially Achieved'), ('Not Achieved', 'Not Achieved')], default='Achieved', help_text='Choose an assessment score', max_length=20), + preserve_default=False, + ), + migrations.AddField( + model_name='cafselfassessmentoutcomescore', + name='self_assessment_score', + field=models.CharField(choices=[('Achieved', 'Achieved'), ('Partially Achieved', 'Partially Achieved'), ('Not Achieved', 'Not Achieved')], default='Achieved', help_text='Choose an assessment score', max_length=20), + preserve_default=False, + ), + ] diff --git a/ctrack/assessments/models.py b/ctrack/assessments/models.py index 07f3813..71525bb 100644 --- a/ctrack/assessments/models.py +++ b/ctrack/assessments/models.py @@ -18,6 +18,7 @@ class CAFSelfAssessment(models.Model): def __str__(self): return f"CAF Self Assessment for {self.caf.applicable_systems.first().organisation.name} - version {self.caf.version}" + class CAFObjective(models.Model): """ One of 4 as set out in the framework... @@ -72,8 +73,18 @@ 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. """ + ASSESSMENT_SCORE = ( + ("Achieved", "Achieved"), + ("Partially Achieved", "Partially Achieved"), + ("Not Achieved", "Not Achieved"), + ) caf_self_assessment = models.ForeignKey(CAFSelfAssessment, on_delete=models.CASCADE) caf_contributing_outcome = models.ForeignKey(CAFContributingOutcome, on_delete=models.CASCADE) + self_assessment_score = models.CharField(max_length=20, choices=ASSESSMENT_SCORE, help_text="Choose an assessment score") + baseline_assessment_score = models.CharField(max_length=20, choices=ASSESSMENT_SCORE, help_text="Choose an assessment score") class Meta: verbose_name = "CAF Self Assessment Outcome Score" + + def __str__(self): + return f"{self.caf_self_assessment} | {self.self_assessment_score}" |