diff options
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r-- | pyaggr3g470r/controllers/abstract.py | 2 | ||||
-rw-r--r-- | pyaggr3g470r/views/views.py | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/pyaggr3g470r/controllers/abstract.py b/pyaggr3g470r/controllers/abstract.py index f67f932c..281e1415 100644 --- a/pyaggr3g470r/controllers/abstract.py +++ b/pyaggr3g470r/controllers/abstract.py @@ -53,6 +53,8 @@ class AbstractController(object): db_filters.add(getattr(self._db_cls, key[:-4]).in_(value)) elif key.endswith('__like'): db_filters.add(getattr(self._db_cls, key[:-6]).like(value)) + elif key.endswith('__ilike'): + db_filters.add(getattr(self._db_cls, key[:-7]).ilike(value)) else: db_filters.add(getattr(self._db_cls, key) == value) return db_filters diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py index c9a92852..58b3e7f0 100644 --- a/pyaggr3g470r/views/views.py +++ b/pyaggr3g470r/views/views.py @@ -322,12 +322,12 @@ def search(): search_title = request.args.get('search_title', 'off') search_content = request.args.get('search_content', 'off') if search_title == 'on': - filters['title__like'] = "%%%s%%" % query + filters['title__ilike'] = "%%%s%%" % query if search_content == 'on': - filters['content__like'] = "%%%s%%" % query + filters['content__ilike'] = "%%%s%%" % query if len(filters) == 0: search_title = 'on' - filters['title__like'] = "%%%s%%" % query + filters['title__ilike'] = "%%%s%%" % query if len(filters) > 1: filters = {"__or__": filters} return render_home(filters, ["%s %s" % (gettext('Search:'), query)], |