gave a name to Author and Book objects

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