summaryrefslogtreecommitdiff
path: root/archaeological_context_records/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2024-07-08 14:09:48 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2024-07-08 18:15:40 +0200
commitf2133b1363d3d275ce063c0cddebb3fb862e2637 (patch)
tree0131f651e3a8bb5347eda18622daf75523f92c82 /archaeological_context_records/forms.py
parent4869a23a5adeeba3160267537ce6acccdf1a3aae (diff)
downloadIshtar-f2133b1363d3d275ce063c0cddebb3fb862e2637.tar.bz2
Ishtar-f2133b1363d3d275ce063c0cddebb3fb862e2637.zip
✨ Context records - identification: switch to multivalued
Diffstat (limited to 'archaeological_context_records/forms.py')
-rw-r--r--archaeological_context_records/forms.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py
index 2ddb8c42d..3a04567ba 100644
--- a/archaeological_context_records/forms.py
+++ b/archaeological_context_records/forms.py
@@ -156,7 +156,7 @@ class RecordSelect(GeoItemSelect, PeriodSelect):
)
unit = forms.ChoiceField(label=_("Unit type"), choices=[])
activity = forms.ChoiceField(label=_("Activity"), choices=[])
- identification = forms.ChoiceField(label=_("Identification"), choices=[])
+ identifications = forms.ChoiceField(label=_("Identification"), choices=[])
cultural_attributions = forms.ChoiceField(
label=_("Cultural attribution"), choices=[], required=False)
parcel = forms.CharField(label=_("Parcel"))
@@ -173,7 +173,7 @@ class RecordSelect(GeoItemSelect, PeriodSelect):
FieldType("ope_relation_types", OpeRelationType),
FieldType("excavation_technics", models.ExcavationTechnicType),
FieldType("activity", models.ActivityType),
- FieldType("identification", models.IdentificationType),
+ FieldType("identifications", models.IdentificationType),
] + GeoItemSelect.TYPES
SITE_KEYS = {"archaeological_site": None}
@@ -494,7 +494,7 @@ class RecordFormInterpretation(CustomForm, ManageOldType):
form_label = _("Interpretation")
form_admin_name = _("Context record - 040 - Interpretation")
form_slug = "contextrecord-040-interpretation"
- base_models = ["cultural_attribution"]
+ base_models = ["cultural_attribution", "identification"]
associated_models = {
"activity": models.ActivityType,
@@ -505,8 +505,10 @@ class RecordFormInterpretation(CustomForm, ManageOldType):
label=_("Interpretation"), widget=forms.Textarea, required=False
)
activity = forms.ChoiceField(label=_("Activity"), required=False, choices=[])
- identification = forms.ChoiceField(
- label=_("Identification"), required=False, choices=[]
+ identification = forms.MultipleChoiceField(
+ label=_("Identification"), choices=[],
+ widget=widgets.Select2Multiple,
+ required=False
)
HEADERS['taq'] = FormHeader(_("Dating complements"))
taq = forms.IntegerField(label=_("TAQ"), required=False)
@@ -516,14 +518,15 @@ class RecordFormInterpretation(CustomForm, ManageOldType):
cultural_attribution = forms.MultipleChoiceField(
label=_("Cultural attributions"), choices=[],
widget=widgets.Select2Multiple,
- required=False)
+ required=False
+ )
datings_comment = forms.CharField(
label=_("Comments on dating"), required=False, widget=forms.Textarea
)
TYPES = [
FieldType("activity", models.ActivityType),
- FieldType("identification", models.IdentificationType),
+ FieldType("identification", models.IdentificationType, True),
FieldType('cultural_attribution', models.CulturalAttributionType,
True),
]