def pretty_title(self, html_links=False): book = self rel_info = book.related_info() names = [(name, Tag.create_url('author', slug)) for name, slug in rel_info['tags']['author']] if 'parents' in rel_info: books = [(name, Book.create_url(slug)) for name, slug in rel_info['parents']] names.extend(reversed(books)) names.append((self.title, self.get_absolute_url())) if html_links: names = ['<a href="%s">%s</a>' % (tag[1], tag[0]) for tag in names] else: names = [tag[0] for tag in names] return ', '.join(names)
def tag_url(category, slug): return Tag.create_url(category, slug)
def tag_url(category, slug): return Tag.create_url(category, slug)