Commit 88da925f authored by KaoruSawade's avatar KaoruSawade

Edited models.py Books get_absolute_url to not str the pk

parent 27d7e4c4
......@@ -24,5 +24,5 @@ class Books(models.Model):
def __str__(self):
return "\'{}\' by {}, {}".format(self.title, self.author.last_name, self.author.first_name)
def get_absolute_url(self):
return reverse('bookshelf:books-detail', args=[str(self.pk)])
return reverse('bookshelf:books-detail', args=[self.pk])
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