diff options
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) | 
