summaryrefslogtreecommitdiff
path: root/archaeological_context_records
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_context_records')
-rw-r--r--archaeological_context_records/forms.py5
-rw-r--r--archaeological_context_records/models.py3
2 files changed, 7 insertions, 1 deletions
diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py
index eb6b57b63..95980b34e 100644
--- a/archaeological_context_records/forms.py
+++ b/archaeological_context_records/forms.py
@@ -32,10 +32,11 @@ from django.forms.formsets import formset_factory
from ishtar_common.utils import get_current_profile, ugettext_lazy as _
from ishtar_common.models import (
- valid_id,
+ Area,
IshtarSiteProfile,
Town,
SpatialReferenceSystem,
+ valid_id,
valid_ids,
)
from archaeological_context_records import models
@@ -140,6 +141,7 @@ class RecordSelect(GeoItemSelect, PeriodSelect):
)
label = forms.CharField(label=_("ID"), max_length=100)
town = get_town_field()
+ area = forms.ChoiceField(label=_("Area"), choices=[])
if settings.COUNTRY == "fr":
operation__code_patriarche = forms.CharField(
max_length=500, widget=OAWidget, label=_("Code PATRIARCHE")
@@ -189,6 +191,7 @@ class RecordSelect(GeoItemSelect, PeriodSelect):
details_on_color = forms.CharField(label=_("Details on color"))
TYPES = PeriodSelect.TYPES + [
+ FieldType('area', Area),
FieldType('cultural_attributions', models.CulturalAttributionType),
FieldType("unit", models.Unit),
FieldType("cr_relation_types", models.RelationType),
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index 8046cef7e..eae4e3720 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -633,6 +633,9 @@ class ContextRecord(
"town": SearchAltName(
pgettext_lazy("key for text search", "town"), "town__cached_label__iexact"
),
+ "area": SearchAltName(
+ pgettext_lazy("key for text search", "area"), "town__areas__label__iexact"
+ ),
"operation__year": SearchAltName(
pgettext_lazy("key for text search", "operation-year"), "operation__year"
),