summaryrefslogtreecommitdiff
path: root/archaeological_context_records/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2020-12-01 13:41:18 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-28 12:15:21 +0100
commitbabba00f09b77972cc35fcea59b31d4615685ab7 (patch)
treeb691a089838807ed00ecf9a9c38a19c27bf35ace /archaeological_context_records/models.py
parent5015e03c0ceabe8ca8a7884e7178bfd246d77788 (diff)
downloadIshtar-babba00f09b77972cc35fcea59b31d4615685ab7.tar.bz2
Ishtar-babba00f09b77972cc35fcea59b31d4615685ab7.zip
Context records: add surface
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r--archaeological_context_records/models.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index 8a1011084..715e6286c 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -559,6 +559,7 @@ class ContextRecord(BulkUpdatedItem, DocumentItem, BaseHistorizedItem,
depth = models.FloatField(_("Depth (m)"), blank=True, null=True)
depth_of_appearance = models.FloatField(
_("Depth of appearance (m)"), blank=True, null=True)
+ surface = models.IntegerField(_("Surface (m2)"), blank=True, null=True)
location = models.TextField(
_("Location"), blank=True, null=True,
help_text=_("A short description of the location of the context "
@@ -647,6 +648,11 @@ class ContextRecord(BulkUpdatedItem, DocumentItem, BaseHistorizedItem,
def __str__(self):
return self.short_label or ""
+ @property
+ def surface_ha(self):
+ if self.surface:
+ return self.surface / 10000.0
+
def public_representation(self):
dct = super(ContextRecord, self).public_representation()
dct.update({