diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-10-01 15:10:07 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-10-24 12:06:08 +0200 |
commit | e55d8d335b682f86439457c577c95b1768543f22 (patch) | |
tree | 8d6e00ce0a1a19b41869b6b6b2ebc5afbb133b64 /archaeological_warehouse/models.py | |
parent | 179b51b530687a6d81c1434d13d12c02afe7abff (diff) | |
download | Ishtar-e55d8d335b682f86439457c577c95b1768543f22.tar.bz2 Ishtar-e55d8d335b682f86439457c577c95b1768543f22.zip |
Manage site and warehouse in shortcut menu - Many fixes on pin
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): |