Commit db50579c authored by Agu Syquia's avatar Agu Syquia

Updated models.py

Added the Books and Author classes and added their respective models.
parent 0cbbfef3
from django.db import models from django.db import models
class Author(models.Model):
first_name = models.CharField(max_length=60)
last_name = models.CharField(max_length=60)
age = models.IntegerField(default=0)
nationality = models.CharField(max_length=60)
bio = models.TextField(max_length=700)
class Books(models.Model):
title = models.CharField(max_length=100)
author = models.ForeignKey(Author, on_delete=models.CASCADE)
publisher = models.CharField(max_length=69)
year_published = models.DateField()
ISBN = models.IntegerField(default=0)
blurb = models.TextField(max_length=200)
# Create your models here. # Create your models here.
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