if self.has_media(type_):
if type_ in Book.formats:
return getattr(self, "%s_file" % type_)
if self.has_media(type_):
if type_ in Book.formats:
return getattr(self, "%s_file" % type_)
rel_info = book.related_info()
names = [(related_tag_name(tag), Tag.create_url('author', tag['slug']))
for tag in rel_info['tags'].get('author', ())]
rel_info = book.related_info()
names = [(related_tag_name(tag), Tag.create_url('author', tag['slug']))
for tag in rel_info['tags'].get('author', ())]
if 'parents' in rel_info:
books = [(name, Book.create_url(slug))
for name, slug in rel_info['parents']]
if 'parents' in rel_info:
books = [(name, Book.create_url(slug))
for name, slug in rel_info['parents']]
# eliminate descendants
l_tags = Tag.objects.filter(category='book',
slug__in=[book.book_tag_slug() for book in parents.iterator()])
# eliminate descendants
l_tags = Tag.objects.filter(category='book',
slug__in=[book.book_tag_slug() for book in parents.iterator()])
'title', 'parent', 'slug')
if filter:
books = books.filter(filter).distinct()
'title', 'parent', 'slug')
if filter:
books = books.filter(filter).distinct()