Skip to content
Snippets Groups Projects
Verified Commit b9e8ed05 authored by TheJoeCoder's avatar TheJoeCoder
Browse files

Add string representation of UserBook

parent d38dc355
Branches
No related tags found
No related merge requests found
...@@ -168,6 +168,9 @@ class UserBook(models.Model): ...@@ -168,6 +168,9 @@ class UserBook(models.Model):
# Last read # Last read
last_read = models.DateTimeField(auto_now_add=True) last_read = models.DateTimeField(auto_now_add=True)
def __str__(self):
return f"{self.user} - {self.book}"
def percentage_read_whole(self): def percentage_read_whole(self):
return round(self.percentage_read * 100) return round(self.percentage_read * 100)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment