From 4b1795003d8bb5c1c3f5f33edf803529d99e6de8 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 1 Dec 2020 13:41:18 +0100 Subject: Context records: add surface --- archaeological_context_records/models.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'archaeological_context_records/models.py') 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({ -- cgit v1.2.3