From abe0902d8c88b1e1acc7a1bff666109f5d18cfe8 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 21 Mar 2017 23:00:22 +0100 Subject: Context records forms/sheet: add documentation types, diameter and depth of appearance (refs #3561) --- archaeological_context_records/models.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'archaeological_context_records/models.py') diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 14e98e76b..4df56c49f 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2012-2016 Étienne Loks +# Copyright (C) 2012-2017 Étienne Loks # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -129,6 +129,15 @@ post_save.connect(post_save_cache, sender=ExcavationTechnicType) post_delete.connect(post_save_cache, sender=ExcavationTechnicType) +class DocumentationType(GeneralType): + class Meta: + verbose_name = _(u"Documentation type") + verbose_name_plural = _(u"Documentation types") + ordering = ('label',) +post_save.connect(post_save_cache, sender=DocumentationType) +post_delete.connect(post_save_cache, sender=DocumentationType) + + class CRBulkView(object): CREATE_SQL = """ CREATE VIEW context_records_cached_label_bulk_update @@ -216,18 +225,21 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms, width = models.FloatField(_(u"Width (m)"), blank=True, null=True) thickness = models.FloatField(_(u"Thickness (m)"), blank=True, null=True) + diameter = models.FloatField(_(u"Diameter (m)"), blank=True, null=True) depth = models.FloatField(_(u"Depth (m)"), blank=True, null=True) + depth_of_appearance = models.FloatField( + _(u"Depth of appearance (m)"), blank=True, null=True) location = models.TextField( _(u"Location"), blank=True, null=True, help_text=_(u"A short description of the location of the context " u"record")) datings = models.ManyToManyField(Dating) + documentations = models.ManyToManyField(DocumentationType, blank=True, + null=True) datings_comment = models.TextField(_(u"Comment on datings"), blank=True, null=True) unit = models.ForeignKey(Unit, verbose_name=_(u"Context record type"), related_name='+', blank=True, null=True) - has_furniture = models.NullBooleanField(_(u"Has furniture?"), blank=True, - null=True) filling = models.TextField(_(u"Filling"), blank=True, null=True) interpretation = models.TextField(_(u"Interpretation"), blank=True, null=True) -- cgit v1.2.3