summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r--archaeological_warehouse/models.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py
index 0a05320fa..4b7201bcc 100644
--- a/archaeological_warehouse/models.py
+++ b/archaeological_warehouse/models.py
@@ -193,7 +193,7 @@ class Warehouse(Address, DocumentItem, GeoItem, QRCodeItem, DashboardFormItem,
self.save()
@property
- def location_types(self):
+ def division_labels(self):
if not self.max_division_number:
return []
return [
@@ -202,6 +202,14 @@ class Warehouse(Address, DocumentItem, GeoItem, QRCodeItem, DashboardFormItem,
]
@property
+ def default_location_types(self):
+ return [
+ wd.container_type.label
+ for wd in WarehouseDivisionLink.objects.filter(
+ warehouse=self).order_by('order').all() if wd.container_type
+ ]
+
+ @property
def associated_filename(self):
return datetime.date.today().strftime('%Y-%m-%d') + '-' + \
slugify(str(self))