from django.db import models
class Questions(models.Model):
question = models.CharField(max_length=50)
choice1 = models.CharField("Choice1", max_length=50,default="option1")
choice2 = models.CharField("Choice2", max_length=50,default="option2")
choice3 = models.CharField("Choice3", max_length=50,default="option3")
choice4 = models.CharField("Choice4", max_length=50,default="option4")
choice = models.CharField("Choice", max_length=50,default="correct option")
def __str__(self):
return self.question
This is a modal for creating a question and its options.
now I want to show all four option with question. when i write
Questions.objects.all()
then I only get a question only now how do i get options with the question.