added get absolute url function for Author model

parent 62eaa83e
...@@ -14,6 +14,9 @@ class Author(models.Model): ...@@ -14,6 +14,9 @@ class Author(models.Model):
def __str__(self): def __str__(self):
return self.first_name + " " + self.last_name return self.first_name + " " + self.last_name
def get_absolute_url(self):
return (reverse('bookshelf:author-details', kwargs={'pk' : self.pk}))
#Book #Book
#title; author; publisher; year_published; ISBN; blurb #title; author; publisher; year_published; ISBN; blurb
......
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