summaryrefslogtreecommitdiff
path: root/archaeological_operations/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-01-29 17:47:02 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-01-29 17:47:02 +0100
commit46af1fc5f7d61d5bcfc516ba5fb645e5892a31a0 (patch)
tree2ecae8d0ce091985d6839784b9d4b406a6455632 /archaeological_operations/models.py
parent0e9d38a6ed4dce4c23e6dfc59869d9d652e6dcfa (diff)
parent36928455883bd9366afe8bbd0c48076866df5802 (diff)
downloadIshtar-46af1fc5f7d61d5bcfc516ba5fb645e5892a31a0.tar.bz2
Ishtar-46af1fc5f7d61d5bcfc516ba5fb645e5892a31a0.zip
Merge branch 'master' into v0.9
Conflicts: archaeological_warehouse/migrations/0020_generate_cache_lbl_for_containers.py
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r--archaeological_operations/models.py11
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: