All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 2m29s
16 lines
404 B
Python
16 lines
404 B
Python
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]}"
|
|
|