summaryrefslogtreecommitdiff
path: root/archaeological_context_records/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_context_records/forms.py')
-rw-r--r--archaeological_context_records/forms.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py
index 4ecb40386..df074c768 100644
--- a/archaeological_context_records/forms.py
+++ b/archaeological_context_records/forms.py
@@ -179,6 +179,9 @@ class RecordSelect(GeoItemSelect, PeriodSelect):
filling = forms.CharField(label=_("Filling"))
interpretation = forms.CharField(label=_("Interpretation"))
parcel = forms.CharField(label=_("Parcel"))
+ periods = forms.ChoiceField(
+ label=_("Periods"), choices=[], required=False
+ )
has_finds = forms.NullBooleanField(label=_("Has finds"))
cr_relation_types = forms.ChoiceField(
label=_("Search within relations"), choices=[]
@@ -192,6 +195,7 @@ class RecordSelect(GeoItemSelect, PeriodSelect):
TYPES = PeriodSelect.TYPES + [
FieldType('area', Area),
+ FieldType("periods", Period),
FieldType('cultural_attributions', models.CulturalAttributionType),
FieldType("unit", models.Unit),
FieldType("cr_relation_types", models.RelationType),
@@ -302,7 +306,10 @@ class RecordFormGeneral(CustomForm, ManageOldType):
form_admin_name = _("Context record - 020 - General")
form_slug = "contextrecord-020-general"
file_upload = True
- base_models = ["documentation", "excavation_technic", "structure", "texture", "color", "inclusion"]
+ base_models = [
+ "documentation", "excavation_technic", "structure", "texture", "color",
+ "inclusion"
+ ]
associated_models = {
"archaeological_site": ArchaeologicalSite,
"parcel": Parcel,
@@ -527,23 +534,18 @@ class DatingForm(ManageOldType, forms.Form):
]
-DatingFormSet = formset_factory(DatingForm, can_delete=True, formset=FormSet)
-DatingFormSet.form_label = _("Dating")
-DatingFormSet.form_admin_name = _("Context record - 030 - Dating")
-DatingFormSet.form_slug = "contextrecord-030-datings"
-
-
class RecordFormInterpretation(CustomForm, ManageOldType):
HEADERS = {}
form_label = _("Interpretation")
form_admin_name = _("Context record - 040 - Interpretation")
form_slug = "contextrecord-040-interpretation"
- base_models = ["cultural_attribution", "identification"]
+ base_models = ["cultural_attribution", "identification", "period"]
associated_models = {
"activity": models.ActivityType,
"identification": models.IdentificationType,
'cultural_attribution': models.CulturalAttributionType,
+ "period": Period,
}
interpretation = forms.CharField(
label=_("Interpretation"), widget=forms.Textarea, required=False
@@ -559,6 +561,10 @@ class RecordFormInterpretation(CustomForm, ManageOldType):
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)
+ period = widgets.Select2MultipleField(
+ label=_("Periods"),
+ required=False,
+ )
cultural_attribution = forms.MultipleChoiceField(
label=_("Cultural attributions"), choices=[],
widget=widgets.Select2Multiple,
@@ -573,6 +579,7 @@ class RecordFormInterpretation(CustomForm, ManageOldType):
FieldType("identification", models.IdentificationType, True),
FieldType('cultural_attribution', models.CulturalAttributionType,
True),
+ FieldType("period", Period, is_multiple=True),
]