Books¶
Book Model¶
| Model field reference | cv.models.publications.Book |
| Authorship set | cv.models.publications.BookAuthorship |
The Book model represents an instance
of books, including information about different
editions of the same book.
Book Views¶
- Book List :
cv.views.CVListView Context object {{object_list}}Template 'cv/lists/book_list.html'URL 'books/'MIME type text/htmlThe book list view produces a page with a list of the author’s books. This may be useful for profiling an authors’ books with, for example, summaries and blurbs. This can be accomplished through the use of custom templates. The default template produces a list of books using the same section formatting as the listing in the book section of the complete CV.
The page renders an instance of the
cv.views.CVListViewview with the named parametermodel_nameset to'book'. The view returns{{object_list}}in the context with four objects on its dot path:total_books- Integer of total number of books from all three managers:
book_published_list- queryset of all published books (uses the
published()method of thePublicationManager) book_revise_list- queryset of all books in the revision process (uses the
revise()method of thePublicationManager) book_inprep_list- queryset of all books in preparation for submission (uses
the
inprep()method of thePublicationManager)
The URL can be accessed in templates by using the URL template filter with the named URL
section_listandmodel_nameparameter equal tobook, i.e.:{% url section_list model_name='book' %}
- Book Detail:
cv.views.CVDetailView Context object {{book}}Template 'cv/details/book_detail.html'URL 'books/<slug:slug>/'MIME type text/htmlThe book detail view produces a page that represents a single book. This could be used to, for example, create a feature page for a published book. The default view includes the title, abstract, edition information, and links to download the citation information in both RIS and BibTeX formats (described below). The page is rendered as an instance of the
cv.views.CVDetailViewwith the named parametersmodel_nameset to'book'andslugset to the book’s slug attribute. The view returns the context{{book}}that represents theBookinstance.The URL can be accessed using the named URL
item_detailwithmodel_nameset to'book'andslugset to the book’s slug attribute, i.e.:{% url item_detail model_name='book' slug='slug-from-short-title' %}
- Book Citation:
cv.views.citation_view() Context object {{book}}Templates 'cv/citations/book.ris''cv/citations/book.bib'URL 'books/<slug:slug>/citation/<str:format>/'MIME types application/x-research-info-systemsorapplication/x-bibtexReturns view to allow citation to be downloaded to citation management software.
The
<str:format>named parameter should be one of:'ris'- will create downloadable citation using Reference Manager format specification (see http://endnote.com/sites/rm/files/m/direct_export_ris.pdf).
'bib'- will create downloadable citation using the BibTeX format specification (see http://www.bibtex.org/Format/)
Book Editions¶
Django-Vitae allows users to link multiple editions of a book with the
BookEdition class. This is done through
a ForeignKey relationship to the book. The
Book model includes the
get_editions() method to return all
editions associated with the book in reverse chronological order
(i.e., newest first).
If an edition has been related to a book, the default templates will use the publication information (publisher, place of publication, ISBN) of the edition instance, not the publication information defined for the book instance.
Custom Methods¶
The Book class has two custom
methods related to editions:
add_edition(dict)¶Creates a new
BookEditioninstance with the referencing theBookinstance on which the user calls the method.
dict: a dictionary containing field/value pairs forBookEditionfields;editionmust be one of thedictkeys