summaryrefslogtreecommitdiff
path: root/archaeological_finds/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-11-22 17:29:13 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-11-22 17:29:13 +0100
commitaa7a9788a76bca58f90add9a7572a12911ff145b (patch)
tree020ef403efe4b11de64b6c12fb86d276aafc9a16 /archaeological_finds/models.py
parentc85fa7441c7548003f4502be876945d104eff986 (diff)
downloadIshtar-aa7a9788a76bca58f90add9a7572a12911ff145b.tar.bz2
Ishtar-aa7a9788a76bca58f90add9a7572a12911ff145b.zip
Finds: add thickness field (refs #3362)
Diffstat (limited to 'archaeological_finds/models.py')
-rw-r--r--archaeological_finds/models.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py
index 6dcbbce65..d957860e7 100644
--- a/archaeological_finds/models.py
+++ b/archaeological_finds/models.py
@@ -417,6 +417,7 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
width = models.FloatField(_(u"Width (cm)"), blank=True, null=True)
height = models.FloatField(_(u"Height (cm)"), blank=True, null=True)
diameter = models.FloatField(_(u"Diameter (cm)"), blank=True, null=True)
+ thickness = models.FloatField(_(u"Thickness (cm)"), blank=True, null=True)
dimensions_comment = models.TextField(_(u"Dimensions comment"),
blank=True, null=True)
mark = models.TextField(_(u"Mark"), blank=True, null=True)
@@ -524,6 +525,12 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
treatments.append((q.all(), findtreat.treatment))
return treatments
+ @property
+ def weight_string(self):
+ if not self.weight:
+ return ""
+ return "{} {}".format(self.weight, self.weight_unit or "")
+
def upstream_treatments(self):
return self._get_treatments(FindUpstreamTreatments, 'upstream')