gave a name to Author and Book objects

parent 1316409c
......@@ -10,6 +10,9 @@ class Author(models.Model):
nationality = models.CharField(max_length = 50)
bio = models.CharField(max_length = 700)
def __str__(self):
return self.first_name + ", " + self.last_name
#Book
#title; author; publisher; year_published; ISBN; blurb
......@@ -21,4 +24,7 @@ class Book(models.Model):
ISBN = models.BigIntegerField(default = 0)
blurb = models.TextField(max_length = 800)
def __str__(self):
return self.title
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