diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-04-15 15:07:19 +0200 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2015-04-16 09:10:35 +0200 |
commit | 7c145da932191effab00f585664980d2e591b3df (patch) | |
tree | 4664a8f2432b974272ec70183342edbece8565bc /pyaggr3g470r/controllers | |
parent | No bad default 'No title' for feed creation (diff) | |
download | newspipe-7c145da932191effab00f585664980d2e591b3df.tar.gz newspipe-7c145da932191effab00f585664980d2e591b3df.tar.bz2 newspipe-7c145da932191effab00f585664980d2e591b3df.zip |
redoing full text search
using SQL LIKE condition
using main home design for displaying results
Diffstat (limited to 'pyaggr3g470r/controllers')
-rw-r--r-- | pyaggr3g470r/controllers/abstract.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pyaggr3g470r/controllers/abstract.py b/pyaggr3g470r/controllers/abstract.py index 8f0a8e3f..29905c0c 100644 --- a/pyaggr3g470r/controllers/abstract.py +++ b/pyaggr3g470r/controllers/abstract.py @@ -25,7 +25,7 @@ class AbstractController(object): each parameters of the function is treated as an equality unless the name of the parameter ends with either "__gt", "__lt", "__ge", "__le", - "__ne" or "__in". + "__ne", "__in" ir "__like". """ if self.user_id is not None: filters[self._user_id_key] = self.user_id @@ -43,6 +43,8 @@ class AbstractController(object): db_filters.add(getattr(self._db_cls, key[:-4]) != value) elif key.endswith('__in'): 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)) else: db_filters.add(getattr(self._db_cls, key) == value) return db_filters |