Add emulated property to sessions
Some checks failed
Django CI/CD / test (push) Successful in 1m16s
Django CI/CD / build-and-push (push) Has been cancelled

This commit is contained in:
2025-01-29 13:43:35 +01:00
parent c2853a3ecc
commit ba6028e43d
10 changed files with 92 additions and 70 deletions

View File

@ -141,6 +141,10 @@ class Purchase(models.Model):
)
created_at = models.DateTimeField(auto_now_add=True)
@property
def standardized_name(self):
return self.name if self.name else self.first_edition.name
@property
def first_edition(self):
return self.editions.first()
@ -220,6 +224,8 @@ class Session(models.Model):
default=None,
)
note = models.TextField(blank=True, null=True)
emulated = models.BooleanField(default=False)
created_at = models.DateTimeField(auto_now_add=True)
modified_at = models.DateTimeField(auto_now=True)