summaryrefslogtreecommitdiff
path: root/archaeological_context_records/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r--archaeological_context_records/models.py65
1 files changed, 64 insertions, 1 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index 3867997de..062535e04 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -347,6 +347,62 @@ post_save.connect(post_save_cache, sender=IdentificationType)
post_delete.connect(post_save_cache, sender=IdentificationType)
+class StructureType(OrderedHierarchicalType):
+ class Meta:
+ verbose_name = _("Structure Type")
+ verbose_name_plural = _("Structure Types")
+ ordering = ("order", "label")
+
+ def __str__(self):
+ return self.label
+
+
+post_save.connect(post_save_cache, sender=StructureType)
+post_delete.connect(post_save_cache, sender=StructureType)
+
+
+class TextureType(OrderedHierarchicalType):
+ class Meta:
+ verbose_name = _("Texture Type")
+ verbose_name_plural = _("Texture Types")
+ ordering = ("order", "label")
+
+ def __str__(self):
+ return self.label
+
+
+post_save.connect(post_save_cache, sender=TextureType)
+post_delete.connect(post_save_cache, sender=TextureType)
+
+
+class ColorType(OrderedHierarchicalType):
+ class Meta:
+ verbose_name = _("Color Type")
+ verbose_name_plural = _("Color Types")
+ ordering = ("order", "label")
+
+ def __str__(self):
+ return self.label
+
+
+post_save.connect(post_save_cache, sender=ColorType)
+post_delete.connect(post_save_cache, sender=ColorType)
+
+
+class InclusionType(OrderedHierarchicalType):
+ class Meta:
+ verbose_name = _("Inclusion Type")
+ verbose_name_plural = _("Inclusion Types")
+ ordering = ("order", "label")
+
+ def __str__(self):
+ return self.label
+
+
+post_save.connect(post_save_cache, sender=InclusionType)
+post_delete.connect(post_save_cache, sender=InclusionType)
+
+
class ExcavationTechnicType(GeneralType):
class Meta:
verbose_name = _("Excavation technique type")
@@ -774,7 +830,9 @@ class ContextRecord(
opening_date = models.DateField(_("Opening date"), blank=True, null=True)
closing_date = models.DateField(_("Closing date"), blank=True, null=True)
length = models.FloatField(_("Length (m)"), blank=True, null=True)
+ excavated_length = models.FloatField(_("Excavated length (m)"), blank=True, null=True)
width = models.FloatField(_("Width (m)"), blank=True, null=True)
+ excavated_width = models.FloatField(_("Excavated width (m)"), blank=True, null=True)
thickness = models.FloatField(_("Thickness (m)"), blank=True, null=True)
diameter = models.FloatField(_("Diameter (m)"), blank=True, null=True)
depth = models.FloatField(_("Depth (m)"), blank=True, null=True)
@@ -786,10 +844,15 @@ class ContextRecord(
_("Location"),
blank=True,
default="",
- help_text=_("A short description of the location of the context " "record"),
+ help_text=_("A short description of the location of the context record"),
)
datings = models.ManyToManyField(Dating, related_name="context_records")
documentations = models.ManyToManyField(DocumentationType, blank=True)
+ structures = models.ManyToManyField(StructureType, blank=True)
+ textures = models.ManyToManyField(TextureType, blank=True)
+ colors = models.ManyToManyField(ColorType, blank=True)
+ details_on_color = models.TextField(_("Details on color"), blank=True, default="")
+ inclusions = models.ManyToManyField(InclusionType, blank=True)
datings_comment = models.TextField(_("Comment on datings"), blank=True, default="")
unit = models.ForeignKey(
Unit,