vault backup: 2025-12-26 02:09:22
All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 2m29s
All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 2m29s
This commit is contained in:
15
stroma/quiz/models/option_model.py
Normal file
15
stroma/quiz/models/option_model.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from django.db import models
|
||||
from .question_model import Question
|
||||
|
||||
|
||||
class Option(models.Model):
|
||||
question = models.ForeignKey(Question, on_delete=models.CASCADE, related_name='options')
|
||||
letter = models.CharField(max_length=1)
|
||||
text = models.TextField()
|
||||
|
||||
class Meta:
|
||||
unique_together = ['question', 'letter']
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.letter}. {self.text[:30]}"
|
||||
|
||||
Reference in New Issue
Block a user