summaryrefslogtreecommitdiff
path: root/archaeological_operations/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-10-11 18:26:59 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-10-11 18:26:59 +0200
commit253023f6c3480e75d1b9977ff2d2869af4262a29 (patch)
tree96fee714f84d06390563bb928ed2a71497efbe5b /archaeological_operations/models.py
parented8291ebd2c5613a9bddffd9380c9f61a08303dd (diff)
downloadIshtar-253023f6c3480e75d1b9977ff2d2869af4262a29.tar.bz2
Ishtar-253023f6c3480e75d1b9977ff2d2869af4262a29.zip
Shortcut menu: limit simple menu to 100 entries by types
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r--archaeological_operations/models.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index 0cebcf292..4dd107da8 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -308,12 +308,13 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,
ordering = ('cached_label',)
@classmethod
- def get_owns(cls, user, menu_filtr=None):
+ def get_owns(cls, user, menu_filtr=None, limit=None):
replace_query = {}
if menu_filtr:
replace_query = {'associated_file': menu_filtr}
owns = super(Operation, cls).get_owns(
- user, replace_query=replace_query)
+ user, replace_query=replace_query,
+ limit=limit)
# owns = owns.annotate(null_count=Count('operation_code'))
# return owns.order_by("common_name", "-year", "operation_code")
return sorted(owns, key=lambda x: x.cached_label)