diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-01-20 23:18:39 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-01-20 23:19:08 +0100 |
commit | ee93f5875555937c1a04dee97668130db699084d (patch) | |
tree | e9f637b9ca917a5c89658ec42dcfcef777ef8db3 | |
parent | b5924814ceb0fa809ec2ab255b98d3fb4431daf8 (diff) | |
download | Ishtar-ee93f5875555937c1a04dee97668130db699084d.tar.bz2 Ishtar-ee93f5875555937c1a04dee97668130db699084d.zip |
Person search: salutation/title fields
-rw-r--r-- | CHANGES.md | 5 | ||||
-rw-r--r-- | ishtar_common/forms_common.py | 3 | ||||
-rw-r--r-- | ishtar_common/models.py | 10 | ||||
-rw-r--r-- | ishtar_common/version.py | 4 |
4 files changed, 19 insertions, 3 deletions
diff --git a/CHANGES.md b/CHANGES.md index 3a9bd80d7..875a7127a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,11 @@ date: 2023-01-20 Ishtar changelog ================ +v4.0.39 - 2023-01-20 +-------------------- + +### Features/improvements ### +- Person search: salutation/title fields v4.0.38 - 2023-01-20 -------------------- diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 9a52915f5..2018b8227 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -763,6 +763,8 @@ class PersonSelect(CustomForm, TableSelect): ) name = forms.CharField(label=_("Name"), max_length=200) surname = forms.CharField(label=_("Surname"), max_length=50) + title = forms.ChoiceField(label=_("Title"), choices=[]) + salutation = forms.CharField(label=_("Salutation"), max_length=200) email = forms.CharField(label=_("Email"), max_length=75) person_types = forms.ChoiceField(label=_("Type"), choices=[]) attached_to = forms.IntegerField( @@ -777,6 +779,7 @@ class PersonSelect(CustomForm, TableSelect): def __init__(self, *args, **kwargs): super(PersonSelect, self).__init__(*args, **kwargs) self.fields["person_types"].choices = models.PersonType.get_types() + self.fields["title"].choices = models.TitleType.get_types() class PersonFormSelection(CustomFormSearch): diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 5dc325e4e..b4a563d7f 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2693,7 +2693,9 @@ class Person(Address, Merge, OwnPerms, ValueGetter, MainItem): SearchVectorConfig("raw_name"), SearchVectorConfig("town"), SearchVectorConfig("attached_to__name"), - SearchVectorConfig("email"), + SearchVectorConfig("email", "raw"), + SearchVectorConfig("title", "raw"), + SearchVectorConfig("salutation", "raw"), ] # search parameters @@ -2715,6 +2717,12 @@ class Person(Address, Merge, OwnPerms, ValueGetter, MainItem): "email": SearchAltName( pgettext_lazy("key for text search", "email"), "email__iexact" ), + "title": SearchAltName( + pgettext_lazy("key for text search", "title"), "title__label__iexact" + ), + "salutation": SearchAltName( + pgettext_lazy("key for text search", "salutation"), "salutation__iexact" + ), "person_types": SearchAltName( pgettext_lazy("key for text search", "type"), "person_types__label__iexact", diff --git a/ishtar_common/version.py b/ishtar_common/version.py index cc08c0360..382c1850b 100644 --- a/ishtar_common/version.py +++ b/ishtar_common/version.py @@ -1,5 +1,5 @@ -# 4.0.38 -VERSION = (4, 0, 38) +# 4.0.39 +VERSION = (4, 0, 39) def get_version(): |