Default Sorting of applications by number
This commit is contained in:
parent
d84a8d2bdd
commit
2ecd552d2b
@ -99,10 +99,11 @@ def overview(request):
|
|||||||
else:
|
else:
|
||||||
sort = sortfilter['sort']
|
sort = sortfilter['sort']
|
||||||
query = query.order_by(sort)
|
query = query.order_by(sort)
|
||||||
|
|
||||||
if sort.startswith('aversion_'):
|
if sort.startswith('aversion_'):
|
||||||
# limit result to last version of an application
|
# limit result to last version of an application
|
||||||
query = query.filter(aversion__id__in=[x.last_version.id for x in Application.objects.all()])
|
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:
|
if 'reverse' in sortfilter:
|
||||||
query = query.reverse()
|
query = query.reverse()
|
||||||
|
Loading…
Reference in New Issue
Block a user