diff options
Diffstat (limited to 'ishtar_common')
| -rw-r--r-- | ishtar_common/locale/django.pot | 96 | ||||
| -rw-r--r-- | ishtar_common/models.py | 48 | ||||
| -rw-r--r-- | ishtar_common/utils.py | 3 | 
3 files changed, 103 insertions, 44 deletions
diff --git a/ishtar_common/locale/django.pot b/ishtar_common/locale/django.pot index db10f3a35..761c7d2b9 100644 --- a/ishtar_common/locale/django.pot +++ b/ishtar_common/locale/django.pot @@ -262,7 +262,6 @@ msgid "Importer configuration error: \"{}\"."  msgstr ""  #: data_importer.py:1497 -#| msgid "Importer configuration error: \"{}\"."  msgid "Import error: {} - \"{}\"."  msgstr "" @@ -814,12 +813,10 @@ msgid "Is an alert"  msgstr ""  #: forms_common.py:1306 -#| msgid "Created"  msgid "Create"  msgstr ""  #: forms_common.py:1307 templates/ishtar/forms/search_query.html:60 -#| msgid "Updated values"  msgid "Update"  msgstr "" @@ -1073,17 +1070,14 @@ msgid "Cannot have symmetrical and an inverse_relation"  msgstr ""  #: models.py:1587 -#| msgid "Contact type"  msgid "Content type"  msgstr ""  #: models.py:1592 -#| msgid "Search vector"  msgid "Search query"  msgstr ""  #: models.py:1593 -#| msgid "Search vector"  msgid "Search queries"  msgstr "" @@ -1456,6 +1450,16 @@ msgstr ""  msgid "Organization types"  msgstr "" +#: models.py:2522 models.py:2650 models.py:3021 +msgctxt "key for text search" +msgid "name" +msgstr "" + +#: models.py:2526 models.py:2662 models.py:3033 models.py:3303 +msgctxt "key for text search" +msgid "type" +msgstr "" +  #: models.py:2537 models.py:2697 models.py:3171 models.py:3616  msgid "Cached name"  msgstr "" @@ -1465,7 +1469,6 @@ msgid "Organizations"  msgstr ""  #: models.py:2571 -#| msgid "New organization"  msgid "unknown organization"  msgstr "" @@ -1501,6 +1504,26 @@ msgstr ""  msgid "Doctor"  msgstr "" +#: models.py:2654 models.py:3025 +msgctxt "key for text search" +msgid "surname" +msgstr "" + +#: models.py:2658 models.py:3029 +msgctxt "key for text search" +msgid "email" +msgstr "" + +#: models.py:2666 models.py:3037 +msgctxt "key for text search" +msgid "organization" +msgstr "" + +#: models.py:2670 +msgctxt "key for text search" +msgid "has-account" +msgstr "" +  #: models.py:2690  msgid "Contact type"  msgstr "" @@ -1537,6 +1560,11 @@ msgstr ""  msgid " - duplicate"  msgstr "" +#: models.py:3017 +msgctxt "key for text search" +msgid "username" +msgstr "" +  #: models.py:3050  msgid "Advanced shortcut menu"  msgstr "" @@ -1585,6 +1613,46 @@ msgstr ""  msgid "License types"  msgstr "" +#: models.py:3295 +msgctxt "key for text search" +msgid "author" +msgstr "" + +#: models.py:3299 +msgctxt "key for text search" +msgid "title" +msgstr "" + +#: models.py:3307 +msgctxt "key for text search" +msgid "reference" +msgstr "" + +#: models.py:3311 +msgctxt "key for text search" +msgid "internal-reference" +msgstr "" + +#: models.py:3315 +msgctxt "key for text search" +msgid "description" +msgstr "" + +#: models.py:3319 +msgctxt "key for text search" +msgid "comment" +msgstr "" + +#: models.py:3323 +msgctxt "key for text search" +msgid "additional-information" +msgstr "" + +#: models.py:3327 +msgctxt "key for text search" +msgid "has-duplicate" +msgstr "" +  #: models.py:3337  msgid "Index"  msgstr "" @@ -1623,7 +1691,6 @@ msgid "Authors (raw)"  msgstr ""  #: models.py:3367 templates/ishtar/blocks/window_image_detail.html:118 -#| msgid "Number of line"  msgid "Number of items"  msgstr "" @@ -2485,7 +2552,6 @@ msgid "help"  msgstr ""  #: templates/blocks/bs_form_snippet.html:47 -#| msgid "Site search"  msgid "Criteria search"  msgstr "" @@ -2607,8 +2673,6 @@ msgid "Yes"  msgstr ""  #: templates/ishtar/blocks/window_image_detail.html:128 -#| msgctxt "Not directory" -#| msgid "File"  msgctxt "not directory"  msgid "File"  msgstr "" @@ -2768,7 +2832,6 @@ msgid "New"  msgstr ""  #: templates/ishtar/forms/success.html:20 -#| msgid "Item successfully saved"  msgid "Form successfully submited"  msgstr "" @@ -3387,7 +3450,6 @@ msgid "delete"  msgstr ""  #: templates/widgets/search_input.html:12 -#| msgid "Material"  msgid "Criteria"  msgstr "" @@ -3403,19 +3465,19 @@ msgstr ""  msgid "Loading..."  msgstr "" -#: utils.py:91 +#: utils.py:88  msgid "You don't have sufficient permissions to do this action."  msgstr "" -#: utils.py:268 +#: utils.py:265  msgid " (...)"  msgstr "" -#: utils.py:341 +#: utils.py:338  msgid "Information"  msgstr "" -#: utils.py:342 +#: utils.py:339  msgid "Load another random image?"  msgstr "" diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 81a391b3b..22b90842c 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -64,7 +64,7 @@ from ishtar_common.models_imports import ImporterModel, ImporterType, \      Import, TargetKeyGroup  from ishtar_common.utils import get_cache, disable_for_loaddata, create_slug, \      get_all_field_names, merge_tsvectors, cached_label_changed, \ -    generate_relation_graph, TXT_SEARCH_COMMENT +    generate_relation_graph  __all__ = [      'ImporterModel', 'ImporterType', 'ImporterDefault', 'ImporterDefaultValues', @@ -2519,11 +2519,11 @@ class Organization(Address, Merge, OwnPerms, ValueGetter):      # alternative names of fields for searches      ALT_NAMES = {          'name': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"name"), +            pgettext_lazy("key for text search", u"name"),              'name__icontains'          ),          'organization_type': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"type"), +            pgettext_lazy("key for text search", u"type"),              'organization_type__label__iexact'          ),      } @@ -2647,27 +2647,27 @@ class Person(Address, Merge, OwnPerms, ValueGetter):      # alternative names of fields for searches      ALT_NAMES = {          'name': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"name"), +            pgettext_lazy("key for text search", u"name"),              'name__icontains'          ),          'surname': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"surname"), +            pgettext_lazy("key for text search", u"surname"),              'surname__icontains'          ),          'email': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"email"), +            pgettext_lazy("key for text search", u"email"),              'email__icontains'          ),          'person_types': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"type"), +            pgettext_lazy("key for text search", u"type"),              'person_types__label__iexact'          ),          'attached_to': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"organization"), +            pgettext_lazy("key for text search", u"organization"),              'attached_to__cached_label__iexact'          ),          'ishtaruser__isnull': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"has-account"), +            pgettext_lazy("key for text search", u"has-account"),              'ishtaruser__isnull'          ),      } @@ -3014,27 +3014,27 @@ class IshtarUser(FullSearch):      # alternative names of fields for searches      ALT_NAMES = {          'username': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"username"), +            pgettext_lazy("key for text search", u"username"),              'user_ptr__username__icontains'          ),          'name': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"name"), +            pgettext_lazy("key for text search", u"name"),              'person__name__icontains'          ),          'surname': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"surname"), +            pgettext_lazy("key for text search", u"surname"),              'person__surname__icontains'          ),          'email': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"email"), +            pgettext_lazy("key for text search", u"email"),              'person__email__icontains'          ),          'person_types': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"type"), +            pgettext_lazy("key for text search", u"type"),              'person__person_types__label__iexact'          ),          'attached_to': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"organization"), +            pgettext_lazy("key for text search", u"organization"),              'person__attached_to__cached_label__iexact'          ),      } @@ -3292,39 +3292,39 @@ class Document(OwnPerms, ImageModel, FullSearch, Imported):      # alternative names of fields for searches      ALT_NAMES = {          'authors': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"author"), +            pgettext_lazy("key for text search", u"author"),              'authors__cached_label__icontains'          ),          'title': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"title"), +            pgettext_lazy("key for text search", u"title"),              'title__icontains'          ),          'source_type': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"type"), +            pgettext_lazy("key for text search", u"type"),              'source_type__label__iexact'          ),          'reference': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"reference"), +            pgettext_lazy("key for text search", u"reference"),              'reference__icontains'          ),          'internal_reference': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"internal-reference"), +            pgettext_lazy("key for text search", u"internal-reference"),              'internal_reference__icontains'          ),          'description': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"description"), +            pgettext_lazy("key for text search", u"description"),              'description__icontains'          ),          'comment': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"comment"), +            pgettext_lazy("key for text search", u"comment"),              'comment__icontains'          ),          'additional_information': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"additional-information"), +            pgettext_lazy("key for text search", u"additional-information"),              'additional_information__icontains'          ),          'duplicate': ( -            pgettext_lazy(TXT_SEARCH_COMMENT, u"has-duplicate"), +            pgettext_lazy("key for text search", u"has-duplicate"),              'duplicate'          ),      } diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index 0e5dd286a..8cb06aacb 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -62,9 +62,6 @@ class BColors:  CSV_OPTIONS = {'delimiter': ',', 'quotechar': '"', 'quoting': QUOTE_ALL} -TXT_SEARCH_COMMENT = "key for text search (no accent, no spaces)" - -  def check_rights(rights=None, redirect_url='/'):      """      Decorator that checks the rights to access the view.  | 
