diff options
Diffstat (limited to 'ctrack')
-rw-r--r-- | ctrack/assessments/models.py | 2 | ||||
-rw-r--r-- | ctrack/organisations/management/commands/populate_db.py | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/ctrack/assessments/models.py b/ctrack/assessments/models.py index 549416d..35484a8 100644 --- a/ctrack/assessments/models.py +++ b/ctrack/assessments/models.py @@ -15,6 +15,8 @@ class CAFSelfAssessment(models.Model): class Meta: verbose_name = "CAF Self Assessment" + def __str__(self): + return f"CAF Self Assessment for {self.caf.applicable_systems.first().organisation.name} - version {self.caf.version}" class CAFObjective(models.Model): """ diff --git a/ctrack/organisations/management/commands/populate_db.py b/ctrack/organisations/management/commands/populate_db.py index edb070f..80ea5d0 100644 --- a/ctrack/organisations/management/commands/populate_db.py +++ b/ctrack/organisations/management/commands/populate_db.py @@ -173,6 +173,13 @@ class Command(BaseCommand): type=etf3, user=user, participants=[inspectors[1], p2], related_caf=_caf ) + # We want to create a CAF with a bunch of scoring now... + _caf2 = CAF.objects.get(pk=1) + _completer = Person.objects.get(pk=1) + caf_assessment = CAFSelfAssessment.objects.create( + caf_id=_caf2.id, completer_id=_completer.id, comments="Random Comments" + ) + # TODO - adapt this so that it records more than just Persons created self.stdout.write( self.style.SUCCESS( @@ -193,10 +200,3 @@ class Command(BaseCommand): name=random.choice(fnames), organisation=org, caf=caf, ) - # We want to create a CAF with a bunch of scoring now... - _caf2 = CAF.objects.get(pk=2) - _completer = Person.objects.get(pk=1) - caf_assessment = CAFSelfAssessment( - caf=_caf2, completer=_completer, comments="Random Comments" - ) - caf_assessment.save() |