This commit is contained in:
Ross
2025-12-04 22:49:16 +00:00
parent 23f7caa937
commit be1fea5fd4
16 changed files with 240 additions and 52 deletions
+8
View File
@@ -25,6 +25,7 @@ class Dinosaur(models.Model):
weight = models.PositiveSmallIntegerField(default=50)
intelligence = models.PositiveSmallIntegerField(default=50)
height = models.PositiveSmallIntegerField(default=50)
facts = models.TextField(blank=True, help_text='One fact per line; shown as bullet points on the card')
created_at = models.DateTimeField(auto_now_add=True)
@@ -34,6 +35,13 @@ class Dinosaur(models.Model):
def __str__(self):
return self.name
@property
def facts_list(self):
"""Return facts as a list of non-empty lines."""
if not self.facts:
return []
return [f.strip() for f in self.facts.splitlines() if f.strip()]
class BackgroundImage(models.Model):
"""Background images used behind card renders.