Commit fae20799 authored by Jan Enzo Salvador's avatar Jan Enzo Salvador

Built the models for the bookshelf app

parent 401fe19d
from django.db import models
# Create your models here.
class Author(models.model):
first_name = models.CharField(max_length = 50, default = "")
last_name = models.CharField(max_length = 30, default = "")
age = models.IntegerField(default = 0)
nationality = models.CharField(max_length = 30, default = "")
bio = models.TextField(max_length = 700, default = "")
class Books(models.model):
title = models.CharField(max_length = 50, default = "")
author = models.ForeignKey(Author, on_delete = models.CASCADE)
publisher = models.CharField(max_length = 50, default = "")
year_published = models.IntegerField(default = 0)
ISBN = models.IntegerField(default = 0)
blurb = models.TextField(max_length = 200, default = "")
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