diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-02-13 17:31:04 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-04-16 16:41:51 +0200 | 
| commit | da01f74f52ed9cae686b688f0117de5a65041300 (patch) | |
| tree | 8c639a25d59660e1668321c3580b717980e4a62a /archaeological_context_records/forms.py | |
| parent | a73a0bad9334fb5d65e4ffd1eb7d65a2f189abc6 (diff) | |
| download | Ishtar-da01f74f52ed9cae686b688f0117de5a65041300.tar.bz2 Ishtar-da01f74f52ed9cae686b688f0117de5a65041300.zip | |
🗃️ Context record - add cultural attribution field (refs #5740)
Diffstat (limited to 'archaeological_context_records/forms.py')
| -rw-r--r-- | archaeological_context_records/forms.py | 15 | 
1 files changed, 14 insertions, 1 deletions
| diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py index 24a94f2f5..d0340cc78 100644 --- a/archaeological_context_records/forms.py +++ b/archaeological_context_records/forms.py @@ -167,6 +167,8 @@ class RecordSelect(GeoItemSelect, PeriodSelect):      unit = forms.ChoiceField(label=_("Unit type"), choices=[])      activity = forms.ChoiceField(label=_("Activity"), choices=[])      identification = forms.ChoiceField(label=_("Identification"), choices=[]) +    cultural_attributions = forms.ChoiceField( +        label=_("Cultural attribution"), choices=[], required=False)      parcel = forms.CharField(label=_("Parcel"))      has_finds = forms.NullBooleanField(label=_("Has finds"))      cr_relation_types = forms.ChoiceField( @@ -175,6 +177,7 @@ class RecordSelect(GeoItemSelect, PeriodSelect):      excavation_technics = forms.ChoiceField(label=_("Excavation techniques"), choices=[])      TYPES = PeriodSelect.TYPES + [ +        FieldType('cultural_attributions', models.CulturalAttributionType),          FieldType("unit", models.Unit),          FieldType("cr_relation_types", models.RelationType),          FieldType("ope_relation_types", OpeRelationType), @@ -496,14 +499,17 @@ RecordRelationsFormSet.form_admin_name = _("Context record - 050 - Relations")  RecordRelationsFormSet.form_slug = "contextrecord-050-recordrelations" -class RecordFormInterpretation(CustomForm, ManageOldType, forms.Form): +class RecordFormInterpretation(CustomForm, ManageOldType): +    HEADERS = {}      form_label = _("Interpretation")      form_admin_name = _("Context record - 040 - Interpretation")      form_slug = "contextrecord-040-interpretation" +    base_models = ["cultural_attribution"]      associated_models = {          "activity": models.ActivityType,          "identification": models.IdentificationType, +        'cultural_attribution': models.CulturalAttributionType,      }      interpretation = forms.CharField(          label=_("Interpretation"), widget=forms.Textarea, required=False @@ -512,10 +518,15 @@ class RecordFormInterpretation(CustomForm, ManageOldType, forms.Form):      identification = forms.ChoiceField(          label=_("Identification"), required=False, choices=[]      ) +    HEADERS['taq'] = FormHeader(_("Dating complements"))      taq = forms.IntegerField(label=_("TAQ"), required=False)      taq_estimated = forms.IntegerField(label=_("Estimated TAQ"), required=False)      tpq = forms.IntegerField(label=_("TPQ"), required=False)      tpq_estimated = forms.IntegerField(label=_("Estimated TPQ"), required=False) +    cultural_attribution = forms.MultipleChoiceField( +        label=_("Cultural attributions"), choices=[], +        widget=widgets.Select2Multiple, +        required=False)      datings_comment = forms.CharField(          label=_("Comments on dating"), required=False, widget=forms.Textarea      ) @@ -523,6 +534,8 @@ class RecordFormInterpretation(CustomForm, ManageOldType, forms.Form):      TYPES = [          FieldType("activity", models.ActivityType),          FieldType("identification", models.IdentificationType), +        FieldType('cultural_attribution', models.CulturalAttributionType, +                  True),      ] | 
