From b9f9eb50906183baa1d1cd1ad3440cb377500394 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 20 Sep 2024 12:28:45 +0200 Subject: ✨ context records, finds edit form: add new fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_context_records/forms.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'archaeological_context_records/forms.py') diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py index 40be1b7de..fe6534ea8 100644 --- a/archaeological_context_records/forms.py +++ b/archaeological_context_records/forms.py @@ -62,6 +62,7 @@ from archaeological_operations.forms import ( RecordRelationsForm as OpeRecordRelationsForm, RecordRelationsFormSetBase, ) +from ishtar_common.models import Person from archaeological_operations.models import ( Period, Parcel, @@ -301,6 +302,7 @@ class RecordFormGeneral(CustomForm, ManageOldType): "texture": models.TextureType, "color": models.ColorType, "inclusion": models.InclusionType, + "excavator": Person, } pk = forms.IntegerField(required=False, widget=forms.HiddenInput) operation_id = forms.IntegerField(widget=forms.HiddenInput) @@ -319,6 +321,13 @@ class RecordFormGeneral(CustomForm, ManageOldType): comment = forms.CharField( label=_("General comment"), widget=forms.Textarea, required=False ) + excavator = forms.IntegerField( + label=_("Excavator"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-person'), + associated_model=Person, + new=True), + validators=[valid_id(Person)], required=False) HEADERS["excavation_technic"] = FormHeader(_("Description")) excavation_technic = forms.MultipleChoiceField( label=_("Excavation techniques"), -- cgit v1.2.3