diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-04-03 15:19:08 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-04-03 15:19:08 +0100 |
commit | 3591b1b87793a2734718390691bdde41af1f8bd0 (patch) | |
tree | 87b98b1fc755f8aabd83484deca73e09c54b84bd /ctrack/assessments | |
parent | c184c99575e03c8b0248b10c65ca234e11695e8d (diff) |
big migration reset
Diffstat (limited to 'ctrack/assessments')
-rw-r--r-- | ctrack/assessments/admin.py | 16 | ||||
-rw-r--r-- | ctrack/assessments/migrations/0001_initial.py | 62 | ||||
-rw-r--r-- | ctrack/assessments/migrations/0002_auto_20200315_1617.py | 38 | ||||
-rw-r--r-- | ctrack/assessments/migrations/0002_cafassessment_caf.py | 22 | ||||
-rw-r--r-- | ctrack/assessments/migrations/0003_auto_20200315_1651.py | 24 | ||||
-rw-r--r-- | ctrack/assessments/migrations/0003_cafassessment_completer.py | 22 | ||||
-rw-r--r-- | ctrack/assessments/migrations/0004_auto_20200315_2003.py | 18 | ||||
-rw-r--r-- | ctrack/assessments/migrations/0005_auto_20200317_1643.py | 25 | ||||
-rw-r--r-- | ctrack/assessments/migrations/0006_auto_20200403_0943.py | 34 | ||||
-rw-r--r-- | ctrack/assessments/models.py | 22 |
10 files changed, 99 insertions, 184 deletions
diff --git a/ctrack/assessments/admin.py b/ctrack/assessments/admin.py index a78dfe0..10c19d0 100644 --- a/ctrack/assessments/admin.py +++ b/ctrack/assessments/admin.py @@ -1,11 +1,11 @@ from django.contrib import admin -from ctrack.assessments.models import CAFSelfAssessment, CAFObjective, CAFPrinciple, CAFContributingOutcome, \ - CAFSelfAssessmentOutcomeScore +from ctrack.assessments.models import CAFAssessment, CAFObjective, CAFPrinciple, CAFContributingOutcome, \ + CAFAssessmentOutcomeScore -class CAFSelfAssessmentAdmin(admin.ModelAdmin): - model = CAFSelfAssessment +class CAFAssessmentAdmin(admin.ModelAdmin): + model = CAFAssessment class CAFObjectiveAdmin(admin.ModelAdmin): @@ -20,12 +20,12 @@ class CAFContributingOutcomeAdmin(admin.ModelAdmin): model = CAFContributingOutcome -class CAFSelfAssessmentOutcomeScoreAdmin(admin.ModelAdmin): - model = CAFSelfAssessmentOutcomeScore +class CAFAssessmentOutcomeScoreAdmin(admin.ModelAdmin): + model = CAFAssessmentOutcomeScore -admin.site.register(CAFSelfAssessment, CAFSelfAssessmentAdmin) +admin.site.register(CAFAssessment, CAFAssessmentAdmin) admin.site.register(CAFObjective, CAFObjectiveAdmin) admin.site.register(CAFPrinciple, CAFPrincipleAdmin) admin.site.register(CAFContributingOutcome, CAFContributingOutcomeAdmin) -admin.site.register(CAFSelfAssessmentOutcomeScore, CAFSelfAssessmentOutcomeScoreAdmin) +admin.site.register(CAFAssessmentOutcomeScore, CAFAssessmentOutcomeScoreAdmin) diff --git a/ctrack/assessments/migrations/0001_initial.py b/ctrack/assessments/migrations/0001_initial.py index 9943e4b..94afdf9 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-03-12 14:57 +# Generated by Django 2.2.9 on 2020-04-03 14:07 from django.db import migrations, models import django.db.models.deletion @@ -9,60 +9,70 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('organisations', '0006_organisation_oes'), - ('caf', '0018_remove_caf_owner'), ] operations = [ migrations.CreateModel( - name='CAFContributingOutcome', + name='CAFAssessment', 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()), + ('comments', models.TextField(max_length=500)), ], + options={ + 'verbose_name': 'CAF Assessment', + }, ), 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)), + ('name', models.CharField(help_text='e.g. Managing Risk', max_length=100)), ('description', models.TextField(max_length=500)), ('order_id', models.IntegerField()), ], + options={ + 'verbose_name': 'CAF Objective', + }, ), migrations.CreateModel( - name='CAFSelfAssessment', + name='CAFPrinciple', 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')), + ('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')), ], + options={ + 'verbose_name': 'CAF Principle', + }, ), migrations.CreateModel( - name='CAFSelfAssessmentOutcomeScore', + name='CAFContributingOutcome', 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')), + ('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()), + ('principle', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.CAFPrinciple')), ], + options={ + 'verbose_name': 'CAF Contributing Outcome', + }, ), migrations.CreateModel( - name='CAFPrinciple', + name='CAFAssessmentOutcomeScore', 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')), + ('assessment_score', models.CharField(choices=[('Achieved', 'Achieved'), ('Partially Achieved', 'Partially Achieved'), ('Not Achieved', 'Not Achieved')], help_text='Choose an assessment score', max_length=20, verbose_name='Assessment Score')), + ('baseline_assessment_score', models.CharField(choices=[('Achieved', 'Achieved'), ('Partially Achieved', 'Partially Achieved'), ('Not Achieved', 'Not Achieved')], help_text='Choose an assessment score', max_length=20, verbose_name='Baseline Score')), + ('caf_assessment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.CAFAssessment', verbose_name='CAF Assessment')), + ('caf_contributing_outcome', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.CAFContributingOutcome', verbose_name='CAF Contributing Outcome')), ], - ), - migrations.AddField( - model_name='cafcontributingoutcome', - name='principle', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.CAFPrinciple'), + options={ + 'verbose_name': 'CAF Assessment Outcome Score', + }, ), ] diff --git a/ctrack/assessments/migrations/0002_auto_20200315_1617.py b/ctrack/assessments/migrations/0002_auto_20200315_1617.py deleted file mode 100644 index 4acd7bb..0000000 --- a/ctrack/assessments/migrations/0002_auto_20200315_1617.py +++ /dev/null @@ -1,38 +0,0 @@ -# Generated by Django 2.2.9 on 2020-03-15 16:17 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('assessments', '0001_initial'), - ] - - operations = [ - migrations.AlterModelOptions( - name='cafcontributingoutcome', - options={'verbose_name': 'CAF Contributing Outcome'}, - ), - migrations.AlterModelOptions( - name='cafobjective', - options={'verbose_name': 'CAF Objective'}, - ), - migrations.AlterModelOptions( - name='cafprinciple', - options={'verbose_name': 'CAF Principle'}, - ), - migrations.AlterModelOptions( - name='cafselfassessment', - options={'verbose_name': 'CAF Self Assessment'}, - ), - migrations.AlterModelOptions( - name='cafselfassessmentoutcomescore', - options={'verbose_name': 'CAF Self Assessment Outcome Score'}, - ), - migrations.AlterField( - model_name='cafobjective', - name='name', - field=models.CharField(help_text='e.g. Managing Risk', max_length=100), - ), - ] diff --git a/ctrack/assessments/migrations/0002_cafassessment_caf.py b/ctrack/assessments/migrations/0002_cafassessment_caf.py new file mode 100644 index 0000000..db08459 --- /dev/null +++ b/ctrack/assessments/migrations/0002_cafassessment_caf.py @@ -0,0 +1,22 @@ +# 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_auto_20200315_1651.py b/ctrack/assessments/migrations/0003_auto_20200315_1651.py deleted file mode 100644 index 2ac72fc..0000000 --- a/ctrack/assessments/migrations/0003_auto_20200315_1651.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 2.2.9 on 2020-03-15 16:51 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('assessments', '0002_auto_20200315_1617'), - ] - - operations = [ - migrations.RenameField( - model_name='cafcontributingoutcome', - old_name='descriptor', - new_name='name', - ), - migrations.AddField( - model_name='cafcontributingoutcome', - name='description', - field=models.TextField(default='', max_length=1000), - preserve_default=False, - ), - ] diff --git a/ctrack/assessments/migrations/0003_cafassessment_completer.py b/ctrack/assessments/migrations/0003_cafassessment_completer.py new file mode 100644 index 0000000..63b3b18 --- /dev/null +++ b/ctrack/assessments/migrations/0003_cafassessment_completer.py @@ -0,0 +1,22 @@ +# 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_auto_20200315_2003.py b/ctrack/assessments/migrations/0004_auto_20200315_2003.py deleted file mode 100644 index 9bb24f9..0000000 --- a/ctrack/assessments/migrations/0004_auto_20200315_2003.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.9 on 2020-03-15 20:03 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('assessments', '0003_auto_20200315_1651'), - ] - - operations = [ - migrations.AlterField( - model_name='cafcontributingoutcome', - name='name', - field=models.CharField(help_text='e.g. Board Direction', max_length=100), - ), - ] diff --git a/ctrack/assessments/migrations/0005_auto_20200317_1643.py b/ctrack/assessments/migrations/0005_auto_20200317_1643.py deleted file mode 100644 index c7af02b..0000000 --- a/ctrack/assessments/migrations/0005_auto_20200317_1643.py +++ /dev/null @@ -1,25 +0,0 @@ -# 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/migrations/0006_auto_20200403_0943.py b/ctrack/assessments/migrations/0006_auto_20200403_0943.py deleted file mode 100644 index c819520..0000000 --- a/ctrack/assessments/migrations/0006_auto_20200403_0943.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 2.2.9 on 2020-04-03 09:43 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('assessments', '0005_auto_20200317_1643'), - ] - - operations = [ - migrations.AlterField( - model_name='cafselfassessmentoutcomescore', - name='baseline_assessment_score', - field=models.CharField(choices=[('Achieved', 'Achieved'), ('Partially Achieved', 'Partially Achieved'), ('Not Achieved', 'Not Achieved')], help_text='Choose an assessment score', max_length=20, verbose_name='Baseline Score'), - ), - migrations.AlterField( - model_name='cafselfassessmentoutcomescore', - name='caf_contributing_outcome', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.CAFContributingOutcome', verbose_name='CAF Contributing Outcome'), - ), - migrations.AlterField( - model_name='cafselfassessmentoutcomescore', - name='caf_self_assessment', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessments.CAFSelfAssessment', verbose_name='CAF Self Assessment'), - ), - migrations.AlterField( - model_name='cafselfassessmentoutcomescore', - name='self_assessment_score', - field=models.CharField(choices=[('Achieved', 'Achieved'), ('Partially Achieved', 'Partially Achieved'), ('Not Achieved', 'Not Achieved')], help_text='Choose an assessment score', max_length=20, verbose_name='Self Assessment Score'), - ), - ] diff --git a/ctrack/assessments/models.py b/ctrack/assessments/models.py index 8eb04a3..ab57fd5 100644 --- a/ctrack/assessments/models.py +++ b/ctrack/assessments/models.py @@ -4,7 +4,7 @@ from ctrack.caf.models import CAF from ctrack.organisations.models import Person -class CAFSelfAssessment(models.Model): +class CAFAssessment(models.Model): """ These are carried out by an OES as result in, or are associated with a CAF. """ @@ -13,10 +13,10 @@ class CAFSelfAssessment(models.Model): comments = models.TextField(max_length=500) class Meta: - verbose_name = "CAF Self Assessment" + verbose_name = "CAF Assessment" def __str__(self): - return f"CAF Self Assessment for {self.caf.applicable_systems.first().organisation.name} - version {self.caf.version}" + return f"CAF Assessment for {self.caf.applicable_systems.first().organisation.name} - version {self.caf.version}" class CAFObjective(models.Model): @@ -68,7 +68,7 @@ class CAFContributingOutcome(models.Model): return " ".join([self.designation, self.name]) -class CAFSelfAssessmentOutcomeScore(models.Model): +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. @@ -78,18 +78,18 @@ class CAFSelfAssessmentOutcomeScore(models.Model): ("Partially Achieved", "Partially Achieved"), ("Not Achieved", "Not Achieved"), ) - caf_self_assessment = models.ForeignKey(CAFSelfAssessment, on_delete=models.CASCADE, - verbose_name="CAF Self Assessment") + 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") - self_assessment_score = models.CharField(max_length=20, choices=ASSESSMENT_SCORE, - help_text="Choose an assessment score", - verbose_name="Self Assessment Score") + 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 Self Assessment Outcome Score" + verbose_name = "CAF Assessment Outcome Score" def __str__(self): - return f"{self.caf_contributing_outcome} | {self.caf_self_assessment} | {self.self_assessment_score}" + return f"{self.caf_contributing_outcome} | {self.caf_assessment} | {self.assessment_score}" |