diff options
author | MR Lemon <matt@matthewlemon> | 2020-05-12 16:31:12 +0100 |
---|---|---|
committer | MR Lemon <matt@matthewlemon> | 2020-05-12 16:31:12 +0100 |
commit | 4201470c63c9719ca90710847985fc548ad9e6b9 (patch) | |
tree | 583ef880a7d7775a79f10511399165a8fca54670 /ctrack/organisations/management/commands/populate_db.py | |
parent | dade2f791d101d1fd582782c50d76fcb95ba5596 (diff) |
basic population of IGP data
Diffstat (limited to '')
-rw-r--r-- | ctrack/organisations/management/commands/populate_db.py | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/ctrack/organisations/management/commands/populate_db.py b/ctrack/organisations/management/commands/populate_db.py index bb963e3..1b10520 100644 --- a/ctrack/organisations/management/commands/populate_db.py +++ b/ctrack/organisations/management/commands/populate_db.py @@ -3,9 +3,10 @@ from random import randint, choice from django.core.management import BaseCommand from django.core.management import CommandParser +from faker import Faker from ctrack.assessments.models import CAFAssessment, CAFObjective, CAFPrinciple, CAFContributingOutcome, \ - CAFAssessmentOutcomeScore + CAFAssessmentOutcomeScore, AchievementLevel, IGP from ctrack.caf.models import CAF from ctrack.caf.tests.factories import ( GradingFactory, @@ -567,6 +568,35 @@ class Command(BaseCommand): ) ] + achievement_levels = [ + AchievementLevel.objects.create( + descriptor="Not Achieved", + colour_description="Red", + colour_hex="#000001" + ), + AchievementLevel.objects.create( + descriptor="Partially Achieved", + colour_description="Amber", + colour_hex="#000002" + ), + AchievementLevel.objects.create( + descriptor="Achieved", + colour_description="Green", + colour_hex="#000003" + ) + ] + + for al in achievement_levels: + for co in cos: + for igp in range(2): + dtext_fake = Faker() + fake_txt = f"IGP {igp}/{al.descriptor}/{co.designation}: {dtext_fake.paragraph()}" + IGP.objects.create( + achievement_level=al, + contributing_outcome=co, + descriptive_text=fake_txt + ) + # We want to create a CAF with a bunch of scoring now... _caf2 = CAF.objects.get(pk=1) |