Default Sorting of applications by number

This commit is contained in:
Norman Jäckel 2012-09-05 22:38:40 +02:00
parent d84a8d2bdd
commit 2ecd552d2b

View File

@ -99,10 +99,11 @@ def overview(request):
else:
sort = sortfilter['sort']
query = query.order_by(sort)
if sort.startswith('aversion_'):
# limit result to last version of an application
query = query.filter(aversion__id__in=[x.last_version.id for x in Application.objects.all()])
else:
query = query.order_by('number')
if 'reverse' in sortfilter:
query = query.reverse()