Commit 6781d806 authored by Migs Atienza's avatar Migs Atienza

Created books_details.html

parent d272edd0
......@@ -12,6 +12,9 @@ class Author(models.Model):
def __str__(self):
return '{} {}'.format(self.first_name, self.last_name)
def get_absolute_url(self):
return reverse('bookshelf:author_details', kwargs={'pk': self.pk})
class Book(models.Model):
title = models.CharField(max_length=100)
......
{% extends 'base.html' %}
{% block title %}{{ object.title }}{% endblock %}
{% block content %}<center>
<h3>
<a href="{{ object.author.get_absolute_url }}">
{{ object.author }}
</a><br/>
<a>
{{ object.publisher }}
</a><br/>
<a>
{{ object.year_published }}
</a><br/>
<a>
{{ object.ISBN }}
</a><br/>
<a>
{{ object.blurb }}
</a>
</h3>
</center>{% endblock %}
{% block links %}
<center><br/><br/><br/><br/><br/>
<a href="home">Home</a>
<a href="books">Books</a>
<a href="authors">Authors</a></center>
{% endblock %}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment