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
commit30344bb4598e7a0d72d6315bdd197f971ecd443c (patch)
tree020ef403efe4b11de64b6c12fb86d276aafc9a16 /archaeological_finds/models.py
parentdf047b01c5f51a00c2f76f841ebd284ec401e99e (diff)
downloadIshtar-30344bb4598e7a0d72d6315bdd197f971ecd443c.tar.bz2
Ishtar-30344bb4598e7a0d72d6315bdd197f971ecd443c.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')