Added the Author and Books models

parent 202d608a
from django.db import models from django.db import models
# Create your models here.
class Author(models.Model):
first_name = models.CharField(max_length=100, blank=True, null=True)
last_name = models.CharField(max_length=100, blank=True, null=True)
age = models.IntegerField(blank=True, null=True)
nationality = models.CharField(max_length=100, blank=True, null=True)
bio = models.TextField(blank=True, null=True)
class Book(models.Model):
title = models.CharField(max_length=255, blank=True, null=True)
course = models.ForeignKey(Author, on_delete=models.CASCADE, null=True)
publisher = models.CharField(max_length=255, blank=True, null=True)
year_published = models.DateField(max_length=255, blank=True, null=True)
ISBN = models.IntegerField(blank=True, null=True)
blurb = models.TextField(blank=True, null=True)
\ 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