fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8f6f6d2
)
anchor filter-books param parts at word beginning
author
Jan Szejko
<janek37@gmail.com>
Tue, 31 Oct 2017 13:27:29 +0000
(14:27 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Tue, 31 Oct 2017 13:27:29 +0000
(14:27 +0100)
src/api/handlers.py
patch
|
blob
|
history
diff --git
a/src/api/handlers.py
b/src/api/handlers.py
index
a869e58
..
27477b3
100644
(file)
--- a/
src/api/handlers.py
+++ b/
src/api/handlers.py
@@
-276,9
+276,9
@@
class FilterBooksHandler(AnonymousBooksHandler):
is_audiobook = is_audiobook == 'true'
books = Book.objects.distinct()
if title_part:
is_audiobook = is_audiobook == 'true'
books = Book.objects.distinct()
if title_part:
- books = books.filter(title__i
contains=
title_part)
+ books = books.filter(title__i
regex='\m' +
title_part)
if author_part is not None:
if author_part is not None:
- books = books.filter(cached_author__i
contains=
author_part)
+ books = books.filter(cached_author__i
regex='\m' +
author_part)
if is_lektura is not None:
books = books.filter(has_audience=is_lektura)
if is_audiobook is not None:
if is_lektura is not None:
books = books.filter(has_audience=is_lektura)
if is_audiobook is not None: