diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-09-27 11:09:04 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-09-27 11:09:31 +0200 |
commit | ccac2c5da06d2cf6cc0c7c9aee56cbb4cda9a319 (patch) | |
tree | f83404ae38319af6981b79b068957074ceed5644 /ishtar_common/models.py | |
parent | be5cb3e7679732fc4d93583c18af3a1df87e52d9 (diff) | |
download | Ishtar-ccac2c5da06d2cf6cc0c7c9aee56cbb4cda9a319.tar.bz2 Ishtar-ccac2c5da06d2cf6cc0c7c9aee56cbb4cda9a319.zip |
Organization: add columns to table - add town search criteria (refs #5447)
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index a133afead..470ea4e72 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2315,16 +2315,19 @@ organization_type_pks_lazy = lazy(OrganizationType.get_or_create_pks, str) class Organization(Address, Merge, OwnPerms, BaseGenderedType, ValueGetter, MainItem): - TABLE_COLS = ("name", "organization_type", "town") + TABLE_COLS = ("name", "organization_type", "address", "town", "precise_town") SLUG = "organization" SHOW_URL = "show-organization" DELETE_URL = "delete-organization" # search parameters - EXTRA_REQUEST_KEYS = {} + EXTRA_REQUEST_KEYS = { + "precise_town": "precise_town__cached_label" + } BASE_SEARCH_VECTORS = [ SearchVectorConfig("name"), SearchVectorConfig("town"), + SearchVectorConfig("precise_town__name"), ] # alternative names of fields for searches @@ -2336,6 +2339,10 @@ class Organization(Address, Merge, OwnPerms, BaseGenderedType, ValueGetter, Main pgettext_lazy("key for text search", "type"), "organization_type__label__iexact", ), + "precise_town": SearchAltName( + pgettext_lazy("key for text search", "town"), + "precise_town__cached_label__iexact", + ), } QA_EDIT = QuickAction( url="organization-qa-bulk-update", |