fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
author/title match ordering in api filter-books + fix lektura/audiobook filters
[wolnelektury.git]
/
src
/
catalogue
/
models
/
book.py
diff --git
a/src/catalogue/models/book.py
b/src/catalogue/models/book.py
index
3715e7b
..
00921b8
100644
(file)
--- a/
src/catalogue/models/book.py
+++ b/
src/catalogue/models/book.py
@@
-615,6
+615,13
@@
class Book(models.Model):
else:
return None
else:
return None
+ def fragment_data(self):
+ fragment = self.choose_fragment()
+ if fragment:
+ return {'title': fragment.book.pretty_title(), 'html': fragment.get_short_text()}
+ else:
+ return None
+
def update_popularity(self):
count = self.tags.filter(category='set').values('user').order_by('user').distinct().count()
try:
def update_popularity(self):
count = self.tags.filter(category='set').values('user').order_by('user').distinct().count()
try: