diff options
Diffstat (limited to 'ctrack/organisations')
-rw-r--r-- | ctrack/organisations/management/commands/populate_db.py | 12 | ||||
-rw-r--r-- | ctrack/organisations/migrations/0001_initial.py | 5 | ||||
-rw-r--r-- | ctrack/organisations/migrations/0002_auto_20200403_1407.py (renamed from ctrack/organisations/migrations/0002_auto_20200220_1434.py) | 7 | ||||
-rw-r--r-- | ctrack/organisations/migrations/0003_auto_20200220_1625.py | 20 | ||||
-rw-r--r-- | ctrack/organisations/migrations/0004_auto_20200220_1634.py | 20 | ||||
-rw-r--r-- | ctrack/organisations/migrations/0005_auto_20200303_0727.py | 18 | ||||
-rw-r--r-- | ctrack/organisations/migrations/0006_organisation_oes.py | 19 |
7 files changed, 13 insertions, 88 deletions
diff --git a/ctrack/organisations/management/commands/populate_db.py b/ctrack/organisations/management/commands/populate_db.py index e5f76ac..bb963e3 100644 --- a/ctrack/organisations/management/commands/populate_db.py +++ b/ctrack/organisations/management/commands/populate_db.py @@ -4,8 +4,8 @@ from random import randint, choice from django.core.management import BaseCommand from django.core.management import CommandParser -from ctrack.assessments.models import CAFSelfAssessment, CAFObjective, CAFPrinciple, CAFContributingOutcome, \ - CAFSelfAssessmentOutcomeScore +from ctrack.assessments.models import CAFAssessment, CAFObjective, CAFPrinciple, CAFContributingOutcome, \ + CAFAssessmentOutcomeScore from ctrack.caf.models import CAF from ctrack.caf.tests.factories import ( GradingFactory, @@ -571,17 +571,17 @@ class Command(BaseCommand): _caf2 = CAF.objects.get(pk=1) _completer = Person.objects.get(pk=1) - caf_self_assessment = CAFSelfAssessment.objects.create( + caf_assessment = CAFAssessment.objects.create( caf_id=_caf2.id, completer_id=_completer.id, comments="Random Comments" ) # TODO Need to create as many of these as there are ContributingOutcomes # Create a single CAFSelfAssessmentOutcomeScore for c in cos: - CAFSelfAssessmentOutcomeScore.objects.create( - caf_self_assessment_id=caf_self_assessment.id, + CAFAssessmentOutcomeScore.objects.create( + caf_assessment_id=caf_assessment.id, caf_contributing_outcome_id=c.id, - self_assessment_score=random.choice(["Achieved", "Partially Achieved", "Not Achieved"]), + assessment_score=random.choice(["Achieved", "Partially Achieved", "Not Achieved"]), baseline_assessment_score=random.choice(["Achieved", "Partially Achieved", "Not Achieved"]) ) diff --git a/ctrack/organisations/migrations/0001_initial.py b/ctrack/organisations/migrations/0001_initial.py index c922874..a420fa1 100644 --- a/ctrack/organisations/migrations/0001_initial.py +++ b/ctrack/organisations/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 2.2.9 on 2020-02-20 14:34 +# Generated by Django 2.2.9 on 2020-04-03 14:07 from django.db import migrations, models import django.db.models.deletion @@ -50,7 +50,8 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=255)), ('slug', django_extensions.db.fields.AutoSlugField(blank=True, editable=False, populate_from=['name'])), - ('designation_type', models.IntegerField(choices=[(1, 'Automatic'), (2, 'Reserve Power')], default=1)), + ('oes', models.BooleanField()), + ('designation_type', models.IntegerField(choices=[(1, 'Automatic'), (2, 'Reserve Power'), (3, 'NA')], default=1)), ('registered_company_name', models.CharField(blank=True, max_length=255)), ('registered_company_number', models.CharField(blank=True, max_length=100)), ('date_updated', models.DateField(auto_now=True)), diff --git a/ctrack/organisations/migrations/0002_auto_20200220_1434.py b/ctrack/organisations/migrations/0002_auto_20200403_1407.py index 6d12071..d9f3aed 100644 --- a/ctrack/organisations/migrations/0002_auto_20200220_1434.py +++ b/ctrack/organisations/migrations/0002_auto_20200403_1407.py @@ -1,5 +1,6 @@ -# Generated by Django 2.2.9 on 2020-02-20 14:34 +# Generated by Django 2.2.9 on 2020-04-03 14:07 +import ctrack.organisations.models from django.conf import settings from django.db import migrations, models import django.db.models.deletion @@ -18,7 +19,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='person', name='updated_by', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + field=models.ForeignKey(on_delete=models.SET(ctrack.organisations.models.Person.get_sentinel_user), to=settings.AUTH_USER_MODEL), ), migrations.AddField( model_name='organisation', @@ -28,7 +29,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='organisation', name='updated_by', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + field=models.ForeignKey(on_delete=models.SET(ctrack.organisations.models.Organisation.get_sentinel_user), to=settings.AUTH_USER_MODEL), ), migrations.AddField( model_name='address', diff --git a/ctrack/organisations/migrations/0003_auto_20200220_1625.py b/ctrack/organisations/migrations/0003_auto_20200220_1625.py deleted file mode 100644 index 65f4478..0000000 --- a/ctrack/organisations/migrations/0003_auto_20200220_1625.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 2.2.9 on 2020-02-20 16:25 - -import ctrack.organisations.models -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('organisations', '0002_auto_20200220_1434'), - ] - - operations = [ - migrations.AlterField( - model_name='organisation', - name='updated_by', - field=models.ForeignKey(on_delete=models.SET(ctrack.organisations.models.Organisation.get_sentinel_user), to=settings.AUTH_USER_MODEL), - ), - ] diff --git a/ctrack/organisations/migrations/0004_auto_20200220_1634.py b/ctrack/organisations/migrations/0004_auto_20200220_1634.py deleted file mode 100644 index 297931e..0000000 --- a/ctrack/organisations/migrations/0004_auto_20200220_1634.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 2.2.9 on 2020-02-20 16:34 - -import ctrack.organisations.models -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('organisations', '0003_auto_20200220_1625'), - ] - - operations = [ - migrations.AlterField( - model_name='person', - name='updated_by', - field=models.ForeignKey(on_delete=models.SET(ctrack.organisations.models.Person.get_sentinel_user), to=settings.AUTH_USER_MODEL), - ), - ] diff --git a/ctrack/organisations/migrations/0005_auto_20200303_0727.py b/ctrack/organisations/migrations/0005_auto_20200303_0727.py deleted file mode 100644 index 8db8302..0000000 --- a/ctrack/organisations/migrations/0005_auto_20200303_0727.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.9 on 2020-03-03 07:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('organisations', '0004_auto_20200220_1634'), - ] - - operations = [ - migrations.AlterField( - model_name='organisation', - name='designation_type', - field=models.IntegerField(choices=[(1, 'Automatic'), (2, 'Reserve Power'), (3, 'NA')], default=1), - ), - ] diff --git a/ctrack/organisations/migrations/0006_organisation_oes.py b/ctrack/organisations/migrations/0006_organisation_oes.py deleted file mode 100644 index 17edfb5..0000000 --- a/ctrack/organisations/migrations/0006_organisation_oes.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2.9 on 2020-03-11 16:56 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('organisations', '0005_auto_20200303_0727'), - ] - - operations = [ - migrations.AddField( - model_name='organisation', - name='oes', - field=models.BooleanField(default=True), - preserve_default=False, - ), - ] |