diff options
| 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 | 
| commit | 854bac3ecaae179fa3c8c6e66893fc3e0c554e26 (patch) | |
| tree | 999157ca04ed2f80a50e2b7aee615820d7e1c06d | |
| parent | dd146785e0eb7921746dc4373a776c4a6c82ac26 (diff) | |
| download | Ishtar-854bac3ecaae179fa3c8c6e66893fc3e0c554e26.tar.bz2 Ishtar-854bac3ecaae179fa3c8c6e66893fc3e0c554e26.zip  | |
Search - Operation: add "old code" search (refs #5456)
| -rw-r--r-- | CHANGES.md | 4 | ||||
| -rw-r--r-- | archaeological_operations/forms.py | 3 | ||||
| -rw-r--r-- | archaeological_operations/models.py | 4 | 
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",  | 
