summaryrefslogtreecommitdiff
path: root/archaeological_warehouse
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_warehouse')
-rw-r--r--archaeological_warehouse/models.py12
-rw-r--r--archaeological_warehouse/urls.py3
2 files changed, 12 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):
diff --git a/archaeological_warehouse/urls.py b/archaeological_warehouse/urls.py
index 26fe4698e..4233771b2 100644
--- a/archaeological_warehouse/urls.py
+++ b/archaeological_warehouse/urls.py
@@ -43,6 +43,9 @@ urlpatterns = [
name='get-container'),
url(r'get-warehouse/(?P<type>.+)?$', views.get_warehouse,
name='get-warehouse'),
+ url(r'get-warehouse-shortcut/(?P<type>.+)?$',
+ views.get_warehouse, name='get-warehouse-shortcut',
+ kwargs={'full': 'shortcut'}),
url(r'autocomplete-container/?$',
views.autocomplete_container, name='autocomplete-container'),
url(r'^show-container(?:/(?P<pk>.+))?/(?P<type>.+)?$', views.show_container,