Start work on sample data command

This commit is contained in:
2021-06-30 15:56:28 +01:00
parent f8624d3b7a
commit b1646d556c
10 changed files with 77 additions and 5 deletions

View File

@@ -15,10 +15,13 @@ class TrainingCategory(models.Model):
class TrainingItem(models.Model):
category = models.ForeignKey('TrainingCategory', on_delete=models.RESTRICT)
category = models.ForeignKey('TrainingCategory', related_name='category', on_delete=models.RESTRICT)
number = models.CharField(max_length=3)
name = models.CharField(max_length=50)
def __str__(self):
return "{}.{} {}".format(self.category.number, self.number, self.name)
# TODO Validation that dates cannot be in the future
class TrainingItemQualification(models.Model):