I have the relationship follow as:
class Question(models.Model):
content = models.CharField(max_length=128)
class Answer(models.Model):
content = models.CharField(max_length=128)
question = models.ForeignKey(Question)
num_vote = models.IntegerField()
I want to retrieve the answers, which have the max voting. I tried this statement but it isn't correctly.
answers = Answer.objects.filter(question__exact=1).annotate(Max('num_vote'))