diff options
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 |
commit | 4b1795003d8bb5c1c3f5f33edf803529d99e6de8 (patch) | |
tree | b691a089838807ed00ecf9a9c38a19c27bf35ace /archaeological_context_records/models.py | |
parent | dfad3d4b9d7779b5fcd125260021d9f008a68a4f (diff) | |
download | Ishtar-4b1795003d8bb5c1c3f5f33edf803529d99e6de8.tar.bz2 Ishtar-4b1795003d8bb5c1c3f5f33edf803529d99e6de8.zip |
Context records: add surface
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r-- | archaeological_context_records/models.py | 6 |
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({ |