From 7576482b37101c122704618a06f716ea22dbba8e Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 18 Sep 2011 09:48:52 -0400 Subject: [PATCH] sort year group --- pandora/item/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora/item/views.py b/pandora/item/views.py index 38d76d285..37f5b74a5 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -67,11 +67,11 @@ def _order_query(qs, sort, prefix='sort__'): def _order_by_group(query): if 'sort' in query: if len(query['sort']) == 1 and query['sort'][0]['key'] == 'items': + order_by = query['sort'][0]['operator'] == '-' and '-items' or 'items' if query['group'] == "year": - order_by = query['sort'][0]['operator'] == '-' and 'items' or '-items' - else: - order_by = query['sort'][0]['operator'] == '-' and '-items' or 'items' - if query['group'] != "keyword": + secondary = query['sort'][0]['operator'] == '-' and '-value_sort' or 'value_sort' + order_by = (order_by, secondary) + elif query['group'] != "keyword": order_by = (order_by, 'value_sort') else: order_by = (order_by,)