Is there a better way to do this
questionobjects = Questions.objects.all()
for questionobject in questionobjects:
answerobjects = Answers.objects.filter(question=questionobject.id).count()
In the above query Answers model has foreign key relation with Questions. But in the above script the query Answer query executes based on the number of questionobjects.
Suppose there are 10 questionobjects then 10 separate answerobject queries take place. Is there a way to do this with a single query because as the number of questionobjects increases, it will be a problem because the number of answerobjects queries also increase