Big visual overhaul docker compsoe file etc
Some checks failed
CI / test-and-quality (push) Failing after 4m4s
Some checks failed
CI / test-and-quality (push) Failing after 4m4s
This commit is contained in:
@@ -24,9 +24,22 @@ class Category(models.Model):
|
||||
|
||||
|
||||
class Question(models.Model):
|
||||
class SceneOrnament(models.TextChoices):
|
||||
AURORA_ARC = "aurora-arc", "Aurora Arc"
|
||||
CONSTELLATION_DUST = "constellation-dust", "Constellation Dust"
|
||||
HARBOR_FLARE = "harbor-flare", "Harbor Flare"
|
||||
SIGNAL_BLOOM = "signal-bloom", "Signal Bloom"
|
||||
SUNBURST_RIBBON = "sunburst-ribbon", "Sunburst Ribbon"
|
||||
|
||||
category = models.ForeignKey(Category, on_delete=models.PROTECT, related_name="questions")
|
||||
prompt = models.TextField()
|
||||
correct_answer = models.CharField(max_length=255)
|
||||
scene_ornament = models.CharField(
|
||||
max_length=64,
|
||||
choices=SceneOrnament.choices,
|
||||
blank=True,
|
||||
default="",
|
||||
)
|
||||
is_active = models.BooleanField(default=True)
|
||||
|
||||
class Meta:
|
||||
@@ -36,6 +49,21 @@ class Question(models.Model):
|
||||
return f"{self.category.name}: {self.prompt[:60]}"
|
||||
|
||||
|
||||
class QuestionLie(models.Model):
|
||||
question = models.ForeignKey(Question, on_delete=models.CASCADE, related_name="fallback_lies")
|
||||
text = models.CharField(max_length=255)
|
||||
is_active = models.BooleanField(default=True)
|
||||
sort_order = models.PositiveIntegerField(default=0)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ["sort_order", "id"]
|
||||
unique_together = (("question", "text"),)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.question.prompt[:40]} -> {self.text}"
|
||||
|
||||
|
||||
class GameSession(models.Model):
|
||||
class Status(models.TextChoices):
|
||||
LOBBY = "lobby", "Lobby"
|
||||
|
||||
Reference in New Issue
Block a user