aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/assessments
diff options
context:
space:
mode:
Diffstat (limited to 'ctrack/assessments')
-rw-r--r--ctrack/assessments/migrations/0001_initial.py55
-rw-r--r--ctrack/assessments/migrations/0002_cafassessment_caf.py22
-rw-r--r--ctrack/assessments/migrations/0003_cafassessment_completer.py22
-rw-r--r--ctrack/assessments/migrations/0004_achievementlevel_igp.py32
-rw-r--r--ctrack/assessments/migrations/0005_auto_20200512_1438.py27
-rw-r--r--ctrack/assessments/models.py45
6 files changed, 74 insertions, 129 deletions
diff --git a/ctrack/assessments/migrations/0001_initial.py b/ctrack/assessments/migrations/0001_initial.py
index 94afdf9..3789ad7 100644
--- a/ctrack/assessments/migrations/0001_initial.py
+++ b/ctrack/assessments/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 2.2.9 on 2020-04-03 14:07
+# Generated by Django 2.2.12 on 2020-08-27 09:40
from django.db import migrations, models
import django.db.models.deletion
@@ -9,20 +9,46 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
+ ('organisations', '0001_initial'),
+ ('caf', '0001_initial'),
]
operations = [
migrations.CreateModel(
+ name='AchievementLevel',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('descriptor', models.CharField(max_length=50)),
+ ('colour_description', models.CharField(max_length=100)),
+ ('colour_hex', models.CharField(max_length=8)),
+ ],
+ ),
+ migrations.CreateModel(
name='CAFAssessment',
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')),
],
options={
'verbose_name': 'CAF Assessment',
},
),
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)),
+ ('name', models.CharField(help_text='e.g. Board Direction', max_length=100)),
+ ('description', models.TextField(max_length=1000)),
+ ('order_id', models.IntegerField()),
+ ],
+ options={
+ 'verbose_name': 'CAF Contributing Outcome',
+ },
+ ),
+ migrations.CreateModel(
name='CAFObjective',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
@@ -35,33 +61,36 @@ class Migration(migrations.Migration):
},
),
migrations.CreateModel(
- name='CAFPrinciple',
+ name='IGP',
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')),
+ ('descriptive_text', models.CharField(max_length=2000)),
+ ('achievement_level', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.AchievementLevel')),
+ ('contributing_outcome', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.CAFContributingOutcome')),
],
options={
- 'verbose_name': 'CAF Principle',
+ 'verbose_name': 'IGP',
},
),
migrations.CreateModel(
- name='CAFContributingOutcome',
+ 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.a, B3.c, etc', max_length=5)),
- ('name', models.CharField(help_text='e.g. Board Direction', max_length=100)),
+ ('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()),
- ('principle', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.CAFPrinciple')),
+ ('caf_objective', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.CAFObjective')),
],
options={
- 'verbose_name': 'CAF Contributing Outcome',
+ 'verbose_name': 'CAF Principle',
},
),
+ migrations.AddField(
+ model_name='cafcontributingoutcome',
+ name='principle',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.CAFPrinciple'),
+ ),
migrations.CreateModel(
name='CAFAssessmentOutcomeScore',
fields=[
diff --git a/ctrack/assessments/migrations/0002_cafassessment_caf.py b/ctrack/assessments/migrations/0002_cafassessment_caf.py
deleted file mode 100644
index db08459..0000000
--- a/ctrack/assessments/migrations/0002_cafassessment_caf.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# Generated by Django 2.2.9 on 2020-04-03 14:07
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- initial = True
-
- dependencies = [
- ('assessments', '0001_initial'),
- ('caf', '0001_initial'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='cafassessment',
- name='caf',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='caf.CAF'),
- ),
- ]
diff --git a/ctrack/assessments/migrations/0003_cafassessment_completer.py b/ctrack/assessments/migrations/0003_cafassessment_completer.py
deleted file mode 100644
index 63b3b18..0000000
--- a/ctrack/assessments/migrations/0003_cafassessment_completer.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# Generated by Django 2.2.9 on 2020-04-03 14:07
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- initial = True
-
- dependencies = [
- ('organisations', '0001_initial'),
- ('assessments', '0002_cafassessment_caf'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='cafassessment',
- name='completer',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organisations.Person'),
- ),
- ]
diff --git a/ctrack/assessments/migrations/0004_achievementlevel_igp.py b/ctrack/assessments/migrations/0004_achievementlevel_igp.py
deleted file mode 100644
index 581a115..0000000
--- a/ctrack/assessments/migrations/0004_achievementlevel_igp.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# Generated by Django 3.0.5 on 2020-05-12 14:00
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('assessments', '0003_cafassessment_completer'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='AchievementLevel',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('descriptor', models.CharField(max_length=50)),
- ('color_description', models.CharField(max_length=100)),
- ('color_hex', models.CharField(max_length=8)),
- ],
- ),
- migrations.CreateModel(
- name='IGP',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('descriptive_text', models.CharField(max_length=2000)),
- ('achievement_level', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.AchievementLevel')),
- ('contributing_outcome', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.CAFContributingOutcome')),
- ],
- ),
- ]
diff --git a/ctrack/assessments/migrations/0005_auto_20200512_1438.py b/ctrack/assessments/migrations/0005_auto_20200512_1438.py
deleted file mode 100644
index 31a741a..0000000
--- a/ctrack/assessments/migrations/0005_auto_20200512_1438.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# Generated by Django 3.0.5 on 2020-05-12 14:38
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('assessments', '0004_achievementlevel_igp'),
- ]
-
- operations = [
- migrations.AlterModelOptions(
- name='igp',
- options={'verbose_name': 'IGP'},
- ),
- migrations.RenameField(
- model_name='achievementlevel',
- old_name='color_description',
- new_name='colour_description',
- ),
- migrations.RenameField(
- model_name='achievementlevel',
- old_name='color_hex',
- new_name='colour_hex',
- ),
- ]
diff --git a/ctrack/assessments/models.py b/ctrack/assessments/models.py
index d3cd4dd..89d83b8 100644
--- a/ctrack/assessments/models.py
+++ b/ctrack/assessments/models.py
@@ -13,16 +13,17 @@ class CAFAssessment(models.Model):
verbose_name = "CAF Assessment"
def get_title(self):
- return f"CAF Assessment for {self.caf.applicable_systems.first().organisation.name} - version {self.caf.version}"
+ return f"CAF Assessment for {self.caf.organisation.name} - version {self.caf.version}"
def __str__(self):
- return f"CAF Assessment for {self.caf.applicable_systems.first().organisation.name} - version {self.caf.version}"
+ return f"CAF Assessment for {self.caf.organisation.name} - version {self.caf.version}"
class CAFObjective(models.Model):
"""
One of 4 as set out in the framework...
"""
+
name = models.CharField(max_length=100, help_text="e.g. Managing Risk")
description = models.TextField(max_length=500)
order_id = models.IntegerField()
@@ -38,6 +39,7 @@ 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)
@@ -55,6 +57,7 @@ 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")
name = models.CharField(max_length=100, help_text="e.g. Board Direction")
description = models.TextField(max_length=1000)
@@ -73,20 +76,32 @@ class CAFAssessmentOutcomeScore(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_assessment = models.ForeignKey(CAFAssessment, on_delete=models.CASCADE,
- verbose_name="CAF Assessment")
- caf_contributing_outcome = models.ForeignKey(CAFContributingOutcome, on_delete=models.CASCADE,
- verbose_name="CAF Contributing Outcome")
- assessment_score = models.CharField(max_length=20, choices=ASSESSMENT_SCORE,
- help_text="Choose an assessment score",
- verbose_name="Assessment Score")
- baseline_assessment_score = models.CharField(max_length=20, choices=ASSESSMENT_SCORE,
- help_text="Choose an assessment score", verbose_name="Baseline Score")
+ caf_assessment = models.ForeignKey(
+ CAFAssessment, on_delete=models.CASCADE, verbose_name="CAF Assessment"
+ )
+ caf_contributing_outcome = models.ForeignKey(
+ CAFContributingOutcome,
+ on_delete=models.CASCADE,
+ verbose_name="CAF Contributing Outcome",
+ )
+ assessment_score = models.CharField(
+ max_length=20,
+ choices=ASSESSMENT_SCORE,
+ help_text="Choose an assessment score",
+ verbose_name="Assessment Score",
+ )
+ baseline_assessment_score = models.CharField(
+ max_length=20,
+ choices=ASSESSMENT_SCORE,
+ help_text="Choose an assessment score",
+ verbose_name="Baseline Score",
+ )
class Meta:
verbose_name = "CAF Assessment Outcome Score"
@@ -98,7 +113,9 @@ class CAFAssessmentOutcomeScore(models.Model):
class AchievementLevel(models.Model):
descriptor = models.CharField(max_length=50)
colour_description = models.CharField(max_length=100)
- colour_hex = models.CharField(max_length=8) # CSS hex code or simple word descriptor
+ colour_hex = models.CharField(
+ max_length=8
+ ) # CSS hex code or simple word descriptor
def __str__(self):
return f"{self.descriptor}"
@@ -106,7 +123,9 @@ class AchievementLevel(models.Model):
class IGP(models.Model):
achievement_level = models.ForeignKey(AchievementLevel, on_delete=models.CASCADE)
- contributing_outcome = models.ForeignKey(CAFContributingOutcome, on_delete=models.CASCADE)
+ contributing_outcome = models.ForeignKey(
+ CAFContributingOutcome, on_delete=models.CASCADE
+ )
descriptive_text = models.CharField(max_length=2000)
class Meta: