+ @classmethod
+ def artist(cls, media):
+ return media.extra_info.get('artist_name', '')
+
+ @classmethod
+ def director(cls, media):
+ return media.extra_info.get('director_name', '')
+
+
+
+class BookDetails(object):
+ """Custom fields used for representing Books."""
+
+ @classmethod
+ def author(cls, book):
+ return ",".join(t[0] for t in book.related_info()['tags'].get('author', []))
+
+ @classmethod
+ def href(cls, book):
+ """ Returns an URI for a Book in the API. """
+ return API_BASE + reverse("api_book", args=[book.slug])
+
+ @classmethod
+ def url(cls, book):
+ """ Returns Book's URL on the site. """
+
+ return WL_BASE + book.get_absolute_url()
+
+ @classmethod
+ def children(cls, book):
+ """ Returns all children for a book. """
+
+ return book.children.all()
+
+ @classmethod
+ def media(cls, book):
+ """ Returns all media for a book. """
+ return book.media.all()
+
+ @classmethod
+ def cover(cls, book):
+ return MEDIA_BASE + book.cover.url if book.cover else ''
+
+ @classmethod
+ def cover_thumb(cls, book):
+ return MEDIA_BASE + default.backend.get_thumbnail(
+ book.cover, "139x193").url if book.cover else ''