From 8ea7f10a84af44af37a5478c389fa040723542ec Mon Sep 17 00:00:00 2001 From: King Date: Thu, 5 Oct 2017 01:05:42 +0530 Subject: Will return the last answer submitted --- yaksh/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'yaksh/models.py') diff --git a/yaksh/models.py b/yaksh/models.py index 92076ab..68bde48 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -1285,7 +1285,7 @@ class AnswerPaper(models.Model): return q_a def get_latest_answer(self, question_id): - return self.answers.filter(question=question_id).order_by("-id").last() + return self.answers.filter(question=question_id).order_by("id").last() def get_questions(self): return self.questions.filter(active=True) -- cgit