Perform natural sort on question number.
parent
4b0a8c297f
commit
f3317badaf
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue