diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-16 19:04:34 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-16 19:04:34 +0200 |
commit | fd5e330ede426a7152deab41620b6a60b63df220 (patch) | |
tree | 02fb227e93c929db6dc4a3d6ef254516bdc6f2fe /archaeological_context_records/models.py | |
parent | 0f88ac0c7abd4ecb5e9bed54474af23752efcbcd (diff) | |
download | Ishtar-fd5e330ede426a7152deab41620b6a60b63df220.tar.bz2 Ishtar-fd5e330ede426a7152deab41620b6a60b63df220.zip |
🗃️ context records new fields, default values, admin interface - town add notice (refs #6024)
Town:
- notice
Context records:
- excavated length
- excavated width
- structure
- texture
- colors
- details on colors
- inclusions
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r-- | archaeological_context_records/models.py | 65 |
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, |