Implemented models Author and Books

parent 419128f9
from django.db import models
# Create your models here.
class Author(models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
age = models.PositiveSmallIntegerField()
nationality = models.CharField(max_length=100)
bio = models.TextField(max_length=700)
class Books(models.Model):
title = models.CharField(max_length=255)
author = models.ForeignKey(Author, on_delete=models.CASCADE)
publisher = models.CharField(max_length=100)
year_published =
ISBN = models.IntegerField(max_length=13)
blurb = models.TextField()
\ No newline at end of file
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