diff options
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 |
commit | 253023f6c3480e75d1b9977ff2d2869af4262a29 (patch) | |
tree | 96fee714f84d06390563bb928ed2a71497efbe5b /archaeological_finds/models.py | |
parent | ed8291ebd2c5613a9bddffd9380c9f61a08303dd (diff) | |
download | Ishtar-253023f6c3480e75d1b9977ff2d2869af4262a29.tar.bz2 Ishtar-253023f6c3480e75d1b9977ff2d2869af4262a29.zip |
Shortcut menu: limit simple menu to 100 entries by types
Diffstat (limited to 'archaeological_finds/models.py')
-rw-r--r-- | archaeological_finds/models.py | 6 |
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): |