aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/organisations/management/commands/populate_db.py
diff options
context:
space:
mode:
authorMR Lemon <matt@matthewlemon>2020-05-12 16:31:12 +0100
committerMR Lemon <matt@matthewlemon>2020-05-12 16:31:12 +0100
commit4201470c63c9719ca90710847985fc548ad9e6b9 (patch)
tree583ef880a7d7775a79f10511399165a8fca54670 /ctrack/organisations/management/commands/populate_db.py
parentdade2f791d101d1fd582782c50d76fcb95ba5596 (diff)
basic population of IGP data
Diffstat (limited to '')
-rw-r--r--ctrack/organisations/management/commands/populate_db.py32
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)