Perform natural sort on question number.

EmailTemplateFixes
Daniel Rozenberg 2014-11-02 14:01:03 -08:00
parent 4b0a8c297f
commit f3317badaf
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ class QuestionSet(models.Model):
def questions(self): def questions(self):
if not hasattr(self, "__qcache"): if not hasattr(self, "__qcache"):
self.__qcache = list(Question.objects.filter(questionset=self.id).order_by('number')) self.__qcache = list(Question.objects.filter(questionset=self.id).extra(select={'numericnumber': 'CAST(number AS UNSIGNED)'}).order_by('numericnumber', 'number'))
return self.__qcache return self.__qcache
def next(self): def next(self):