diff options
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), ] |