Commit fec011a4 authored by Rafa Mendoza's avatar Rafa Mendoza

fixed formating for models

parent 3fbdeee5
...@@ -9,6 +9,15 @@ class Author(models.Model): ...@@ -9,6 +9,15 @@ 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 '''{}, {}, {}, {}, {}'''.format(
self.first_name,
self.last_name,
self.age,
self.nationality,
self.bio,
)
class Books(models.Model): class Books(models.Model):
title = models.CharField(max_length=125) title = models.CharField(max_length=125)
...@@ -17,3 +26,13 @@ class Books(models.Model): ...@@ -17,3 +26,13 @@ class Books(models.Model):
year_published = models.IntegerField(max_length=100) year_published = models.IntegerField(max_length=100)
isbn = models.CharField(max_length=13) isbn = models.CharField(max_length=13)
blurb = models.TextField() blurb = models.TextField()
def __str__(self):
return '''{}, {}, {}, {}, {}, {}'''.format(
self.title,
self.author,
self.publisher,
self.year_published,
self.isbn,
self.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