summaryrefslogtreecommitdiff
path: root/archaeological_context_records
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2024-09-20 12:28:45 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2024-09-20 15:47:14 +0200
commitb9f9eb50906183baa1d1cd1ad3440cb377500394 (patch)
tree5dd4f2a6a2e78017f07d8e7fd942db5ec8109fb3 /archaeological_context_records
parent2089f69b8958ba08879a706d478397e927de8741 (diff)
downloadIshtar-b9f9eb50906183baa1d1cd1ad3440cb377500394.tar.bz2
Ishtar-b9f9eb50906183baa1d1cd1ad3440cb377500394.zip
✨ context records, finds edit form: add new fields
Diffstat (limited to 'archaeological_context_records')
-rw-r--r--archaeological_context_records/forms.py9
-rw-r--r--archaeological_context_records/models.py1
2 files changed, 10 insertions, 0 deletions
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"),
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index c1a03e79e..a832e2476 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -751,6 +751,7 @@ class ContextRecord(
SearchVectorConfig("datings_comment", "local"),
SearchVectorConfig("unit__label"),
SearchVectorConfig("activity__label"),
+ SearchVectorConfig("excavator__raw_name", "raw"),
]
M2M_SEARCH_VECTORS = [
SearchVectorConfig("datings__period__label", "local"),