Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. # Create your models here.
  2. class Book(models.Model):
  3.  
  4. title = models.CharField(max_length=100)
  5. description = models.CharField(max_length=400)
  6. publisher = models.CharField(max_length=400)
  7. release_date = models.DateField()
  8.  
  9.  
  10. class Author(models.Model):
  11. name = models.CharField(max_length=225)
  12. biography = models.TextField()
  13. date_of_birth = models.DateField()
  14. books = models.ManyToManyField('Book', related_name='authors', blank=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement