summaryrefslogtreecommitdiff
path: root/archaeological_finds/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
commit7a504b1f0b3c58875ea852e94c0da05bd9d84890 (patch)
tree96fee714f84d06390563bb928ed2a71497efbe5b /archaeological_finds/models.py
parentdbc177886d29dcf7a39916189ce712d1bca16ef4 (diff)
downloadIshtar-7a504b1f0b3c58875ea852e94c0da05bd9d84890.tar.bz2
Ishtar-7a504b1f0b3c58875ea852e94c0da05bd9d84890.zip
Shortcut menu: limit simple menu to 100 entries by types
Diffstat (limited to 'archaeological_finds/models.py')
-rw-r--r--archaeological_finds/models.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py
index 722d165ce..5581df084 100644
--- a/archaeological_finds/models.py
+++ b/archaeological_finds/models.py
@@ -587,11 +587,13 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
Q(history_creator=user)
@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 = {'base_finds__context_record': menu_filtr}
- owns = super(Find, cls).get_owns(user, replace_query=replace_query)
+ owns = super(Find, cls).get_owns(
+ user, replace_query=replace_query,
+ limit=limit)
return sorted(owns, key=lambda x: x.cached_label)
def _generate_cached_label(self):