summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-03-01 16:42:40 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-03-01 16:42:51 +0100
commit50d10a42d0babafefc0108d8a90afab8eb6bf097 (patch)
tree999157ca04ed2f80a50e2b7aee615820d7e1c06d
parent3debfc8570120bee6b6ae597c5de71aef3cbecce (diff)
downloadIshtar-50d10a42d0babafefc0108d8a90afab8eb6bf097.tar.bz2
Ishtar-50d10a42d0babafefc0108d8a90afab8eb6bf097.zip
Search - Operation: add "old code" search (refs #5456)
-rw-r--r--CHANGES.md4
-rw-r--r--archaeological_operations/forms.py3
-rw-r--r--archaeological_operations/models.py4
3 files changed, 10 insertions, 1 deletions
diff --git a/CHANGES.md b/CHANGES.md
index 630c90926..71db3fcbc 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -10,7 +10,6 @@ Ishtar changelog
- General:
- add custom cached_label configuration for each main item
- add "created" field on main items in order to facilitate queries
-- Search: add created before/after field
- Sheet document: better UI for files
- Model: add history for document and containers
- Menu: remove "Administration" entry - put Account management in "Directory" entry
@@ -19,6 +18,9 @@ Ishtar changelog
- overload index to add subsection headers
- Geo: create/edit form - new openlayers version - add default IGN tiles
- Import: improve bad encoding detection
+- Search:
+ - add created before/after field
+ - Operation: add "old code" search
- Free text search:
- use accent and unaccented string
- add french_archeo thesaurus config
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py
index cf63b51c4..bcc568b86 100644
--- a/archaeological_operations/forms.py
+++ b/archaeological_operations/forms.py
@@ -493,6 +493,9 @@ class OperationSelect(GeoItemSelect):
max_length=500,
widget=OAWidget,
label="Code PATRIARCHE")
+ old_code = forms.CharField(
+ max_length=200,
+ label=_("Old code"))
drassm_code = forms.CharField(
label=_("DRASSM code"), required=False, max_length=100)
towns = get_town_field()
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index d5110df9c..fda6101d2 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -1090,6 +1090,10 @@ class Operation(
"operation_code": SearchAltName(
pgettext_lazy("key for text search", "operation-code"), "operation_code"
),
+ "old_code": SearchAltName(
+ pgettext_lazy("key for text search", "operation-old-code"),
+ "old_code__iexact"
+ ),
"code_patriarche": SearchAltName(
pgettext_lazy("key for text search", "patriarche"),
"code_patriarche__iexact",