I have the relationship follow as:
class Question(models.Model):
qid = models.PositiveIntegerField(primary_key=True)
content = models.CharField(max_length=128)
class Answer(models.Model):
answerid = models.PositiveIntegerField(primary_key=True)
content = models.CharField(max_length=128)
question = models.ForeignKey(Question)
I want to find the questions, which have the answer. How can I do it?
Please help me to solve this problem.
Thank you so much.
If you are trying to find all the questions that have answers: