summaryrefslogtreecommitdiff
path: root/archaeological_context_records/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-01-29 17:33:45 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-01-29 17:33:45 +0100
commit478befbbf1705b8547f8e88a4b5822d3bad52200 (patch)
treedd6c2f8bff2ffb12c210f13090ecf845ef182560 /archaeological_context_records/models.py
parent019f483daeb9fca526ef5f46fda650f01c551fc0 (diff)
downloadIshtar-478befbbf1705b8547f8e88a4b5822d3bad52200.tar.bz2
Ishtar-478befbbf1705b8547f8e88a4b5822d3bad52200.zip
Fix performance issues for shortcut menu
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r--archaeological_context_records/models.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index 518610aa5..cd0dd4268 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -269,14 +269,16 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms,
Q(history_creator=user)
@classmethod
- def get_owns(cls, user, menu_filtr=None, limit=None):
+ def get_owns(cls, user, menu_filtr=None, limit=None,
+ values=None, get_short_menu_class=None):
replace_query = None
if menu_filtr and 'operation' in menu_filtr:
replace_query = Q(operation=menu_filtr['operation'])
owns = super(ContextRecord, cls).get_owns(
user, replace_query=replace_query,
- limit=limit)
- return sorted(owns, key=lambda x: x.cached_label)
+ limit=limit, values=values,
+ get_short_menu_class=get_short_menu_class)
+ return cls._return_get_owns(owns, values, get_short_menu_class)
def full_label(self):
return unicode(self)