From 79b7990e70efdbfa0f93e10ff5f718deedf19da1 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 5 Jun 2019 15:34:05 +0200 Subject: Searches: fix history modifier --- ishtar_common/models.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index c9a66f861..e5235f808 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1866,6 +1866,21 @@ class BaseHistorizedItem(FullSearch, Imported, JsonData, FixAssociated): last_modified = models.DateTimeField(auto_now=True) history_m2m = JSONField(default={}, blank=True) + ALT_NAMES = { + 'history_creator': SearchAltName( + pgettext_lazy("key for text search", u"created-by"), + 'history_creator__ishtaruser__person__cached_label__iexact' + ), + 'history_modifier': SearchAltName( + pgettext_lazy("key for text search", u"modified-by"), + 'history_modifier__ishtaruser__person__cached_label__iexact' + ), + 'modified_since': SearchAltName( + pgettext_lazy("key for text search", u"modified-since"), + 'last_modified__gte' + ), + } + class Meta: abstract = True @@ -4531,6 +4546,7 @@ class Document(BaseHistorizedItem, OwnPerms, ImageModel, ValueGetter, MainItem): 'warehouses__name__iexact' ), } + ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES) objects = ExternalIdManager() RELATIVE_SESSION_NAMES = [ -- cgit v1.2.3