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 | 7a504b1f0b3c58875ea852e94c0da05bd9d84890 (patch) | |
| tree | 96fee714f84d06390563bb928ed2a71497efbe5b /archaeological_operations/models.py | |
| parent | dbc177886d29dcf7a39916189ce712d1bca16ef4 (diff) | |
| download | Ishtar-7a504b1f0b3c58875ea852e94c0da05bd9d84890.tar.bz2 Ishtar-7a504b1f0b3c58875ea852e94c0da05bd9d84890.zip | |
Shortcut menu: limit simple menu to 100 entries by types
Diffstat (limited to 'archaeological_operations/models.py')
| -rw-r--r-- | archaeological_operations/models.py | 5 | 
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) | 
