SQL optimisation of detailed training record

This commit is contained in:
2021-12-28 12:13:08 +00:00
parent 7c830ee7e5
commit 732affa0b2
3 changed files with 6 additions and 3 deletions

View File

@@ -67,7 +67,10 @@ class TrainingItem(models.Model):
return "{}.{}".format(self.category.reference_number, self.reference_number)
def __str__(self):
return "{} {}".format(self.number, self.name)
name = "{} {}".format(self.number, self.name)
if not self.active:
name += " (inactive)"
return name
@staticmethod
def user_has_qualification(item, user, depth):