From: Marcin Koziej Date: Wed, 18 Dec 2013 11:11:16 +0000 (+0100) Subject: proper sorting of pictures in gallery view X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/85800bcf632ba3e027667835b08f8e0dc5ab6177?ds=inline;hp=--cc proper sorting of pictures in gallery view --- 85800bcf632ba3e027667835b08f8e0dc5ab6177 diff --git a/apps/picture/views.py b/apps/picture/views.py index 8acce820b..4d5d85499 100644 --- a/apps/picture/views.py +++ b/apps/picture/views.py @@ -29,8 +29,8 @@ def picture_list_thumb(request, filter=None, get_filter=None, template_name='pic book_list = book_list.filter(filter) if get_filter: book_list = book_list.filter(get_filter()) + book_list = book_list.order_by('sort_key_author') book_list = list(book_list) - book_list.sort(lambda a,b: cmp(a.extra_info['authors'][0], b.extra_info['authors'][0])) return render_to_response(template_name, locals(), context_instance=RequestContext(request))