diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-29 17:53:48 +0100 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-29 17:53:48 +0100 |
| commit | 9336b2fb13ca1bb0c1188b94d76b4d939de46fc7 (patch) | |
| tree | b7baef76b6bad9ffa7071155ed389cfb49aca644 /archaeological_operations/models.py | |
| parent | 01aa41952a6886384e4acce7422cb0abaa22543b (diff) | |
| parent | e245de085cd29246f4da1b32e727e255cab1c645 (diff) | |
| download | Ishtar-9336b2fb13ca1bb0c1188b94d76b4d939de46fc7.tar.bz2 Ishtar-9336b2fb13ca1bb0c1188b94d76b4d939de46fc7.zip | |
Merge branch 'v0.9' into wheezy
Diffstat (limited to 'archaeological_operations/models.py')
| -rw-r--r-- | archaeological_operations/models.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 4a900c276..30cd61010 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -379,16 +379,17 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms, ordering = ('cached_label',) @classmethod - def get_owns(cls, user, menu_filtr=None, limit=None): + def get_owns(cls, user, menu_filtr=None, limit=None, values=None, + get_short_menu_class=None): replace_query = None if menu_filtr and 'file' in menu_filtr: replace_query = Q(associated_file=menu_filtr['file']) + owns = super(Operation, cls).get_owns( 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) + limit=limit, values=values, + get_short_menu_class=get_short_menu_class) + return cls._return_get_owns(owns, values, get_short_menu_class) def __unicode__(self): if self.cached_label: |
