diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-09-25 15:55:44 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:20 +0100 |
commit | 3b0d8214cb1c4a05a3a2de392e49181ffeaf2ff6 (patch) | |
tree | a4a83fe121ae05d495c7a04067f3f59575331196 /archaeological_warehouse/models.py | |
parent | d2b55c340eabed840693326417821f280e1ae59d (diff) | |
download | Ishtar-3b0d8214cb1c4a05a3a2de392e49181ffeaf2ff6.tar.bz2 Ishtar-3b0d8214cb1c4a05a3a2de392e49181ffeaf2ff6.zip |
Containers: fix division default labels
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r-- | archaeological_warehouse/models.py | 10 |
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)) |