diff options
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r-- | archaeological_warehouse/models.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index e46aae13b..798ab78e0 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -30,7 +30,7 @@ from django.utils.translation import ugettext_lazy as _, pgettext_lazy, \ from ishtar_common.data_importer import post_importer_action from ishtar_common.models import Document, GeneralType, get_external_id, \ LightHistorizedItem, OwnPerms, Address, Person, post_save_cache, \ - ImageModel, DashboardFormItem, ExternalIdManager + ImageModel, DashboardFormItem, ExternalIdManager, ShortMenuItem from ishtar_common.utils import cached_label_changed @@ -45,7 +45,8 @@ post_save.connect(post_save_cache, sender=WarehouseType) post_delete.connect(post_save_cache, sender=WarehouseType) -class Warehouse(Address, DashboardFormItem, OwnPerms): +class Warehouse(Address, DashboardFormItem, OwnPerms, + ShortMenuItem): SLUG = 'warehouse' SHOW_URL = 'show-warehouse' TABLE_COLS = ['name', 'warehouse_type'] @@ -124,7 +125,12 @@ class Warehouse(Address, DashboardFormItem, OwnPerms): @classmethod def get_query_owns(cls, ishtaruser): - return Q(person_in_charge__ishtaruser=ishtaruser) + return cls._construct_query_own( + '', cls._get_query_owns_dicts(ishtaruser)) + + @classmethod + def _get_query_owns_dicts(cls, ishtaruser): + return [{'person_in_charge__ishtaruser': ishtaruser}] @property def number_of_finds(self): |