fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
when published date is NaN, set to 0
[wolnelektury.git]
/
apps
/
catalogue
/
templatetags
/
catalogue_tags.py
diff --git
a/apps/catalogue/templatetags/catalogue_tags.py
b/apps/catalogue/templatetags/catalogue_tags.py
index
e8bc138
..
e2aac35
100644
(file)
--- a/
apps/catalogue/templatetags/catalogue_tags.py
+++ b/
apps/catalogue/templatetags/catalogue_tags.py
@@
-350,7
+350,6
@@
def related_books(book, limit=6, random=1):
cache_key = "catalogue.related_books.%d.%d" % (book.id, limit - random)
related = cache.get(cache_key)
if related is None:
cache_key = "catalogue.related_books.%d.%d" % (book.id, limit - random)
related = cache.get(cache_key)
if related is None:
- print 'not in cache'
related = list(Book.objects.filter(
common_slug=book.common_slug).exclude(pk=book.pk)[:limit])
limit -= len(related)
related = list(Book.objects.filter(
common_slug=book.common_slug).exclude(pk=book.pk)[:limit])
limit -= len(related)