diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-08-17 14:54:02 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:23:17 +0100 |
commit | 47b8c7e1acddb890ecce1e7f13352bd5b31d8d24 (patch) | |
tree | b4f5caee4458929bddb2371863abd9a2d1163ee8 /ishtar_common | |
parent | 5d9d9a35eb15eb5cfee880ca1ef185dcf16b2817 (diff) | |
download | Ishtar-47b8c7e1acddb890ecce1e7f13352bd5b31d8d24.tar.bz2 Ishtar-47b8c7e1acddb890ecce1e7f13352bd5b31d8d24.zip |
Add "is locked" search (refs #5419)
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/forms.py | 3 | ||||
-rw-r--r-- | ishtar_common/models.py | 2 | ||||
-rw-r--r-- | ishtar_common/models_common.py | 2 | ||||
-rw-r--r-- | ishtar_common/views_item.py | 4 |
4 files changed, 6 insertions, 5 deletions
diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index d181b975d..5a16a508f 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -942,7 +942,7 @@ class HistorySelect(CustomForm, TableSelect): modified_after = forms.DateField( label=_("Modified after"), widget=DatePicker, required=False ) - locked = forms.BooleanField(label=_("Is locked ?")) + locked = forms.NullBooleanField(label=_("Is locked?")) _explicit_ordering = True CURRENT_FIELDS = [ @@ -983,6 +983,7 @@ class DocumentItemSelect(HistorySelect): "history_modifier", "modified_before", "modified_after", + "locked", ] _explicit_ordering = True diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 0ee33d5ed..e7520ee95 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3803,7 +3803,7 @@ class Document( SearchVectorConfig("tags__label"), ] - BOOL_FIELDS = ["duplicate"] + BOOL_FIELDS = BaseHistorizedItem.BOOL_FIELDS + ["duplicate"] COL_LABELS = { "authors__cached_label": _("Authors"), diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index d1b20215b..b2cb095e6 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -1447,7 +1447,7 @@ class BaseHistorizedItem( pgettext_lazy("key for text search", "modified-after"), "last_modified__gte" ), "locked": SearchAltName( - pgettext_lazy("key for text search", "locked"), "locked__test" + pgettext_lazy("key for text search", "locked"), "locked" ) } diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index 68a340a75..5d1ed582a 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -1921,8 +1921,8 @@ def get_item( my_relation_types_prefix["relation_types"] = "" relation_types = _get_relation_type_dict(my_relation_types_prefix, dct) - exc_relation_types =_get_relation_type_dict(my_relation_types_prefix, - excluded_dct) + exc_relation_types = _get_relation_type_dict(my_relation_types_prefix, + excluded_dct) _manage_bool_fields( model, my_bool_fields, my_reversed_bool_fields, dct, or_reqs |