I have three models, one topic can have zero or more questions, one question can have zero or many answers. Only one answer is correct.
They have a lot of relationships.
class Topic(models.Model): class Question(models.Model): topic = models.ForeignKey(Topic) class Answer(models.Model): question = models.ForeignKey(Question) isright = models.BooleanField(verbose_name='Right')
Now I tried to ask a question based on the topic, how can I achieve it with a template?
<topic> <question> <answer> <answer> <answer> <answer> <question> <answer> <answer> <answer> <answer>
How can I add a paginator for the question?
paginator = Paginator(topic.question_set.all(), 25)
source share