- related = list(Book.objects.filter(
- common_slug=book.common_slug).exclude(pk=book.pk)[:limit])
- limit -= len(related)
- if limit > random:
- related += Book.tagged.related_to(book,
- Book.objects.exclude(common_slug=book.common_slug),
- ignore_by_tag=book.book_tag())[:limit-random]
+ related = Book.tagged.related_to(book,
+ Book.objects.exclude(common_slug=book.common_slug),
+ ignore_by_tag=book.book_tag())[:limit-random]