Commit 522b9f3f authored by Jan Ericsson Ong Ang's avatar Jan Ericsson Ong Ang

fix settings.py error & added paramters to models

parent bff36b99
......@@ -2,22 +2,22 @@ from django.db import models
# Create your models here.
class Author(models.Model):
first_name = models.CharField()
last_name = models.CharField()
age = models.IntegerField()
nationality = models.CharField()
first_name = models.CharField(max_length=50, default="")
last_name = models.CharField(max_length=50, default="")
age = models.IntegerField(default=0)
nationality = models.CharField(max_length=50, default="")
bio = models.TextField(max_length=700, default="")
def __str__(self):
return self.first_name + " " + self.last_name
class Books(models.Model):
title = models.CharField()
title = models.CharField(max_length=50, default="")
author = models.ForeignKey(Author, on_delete=models.CASCADE)
publisher = models.CharField()
year_published = models.IntegerField()
ISBN = models.IntegerField()
blurb = models.TextField()
publisher = models.CharField(max_length=50, default="")
year_published = models.IntegerField(default=0)
ISBN = models.IntegerField(default=0)
blurb = models.TextField(default="")
def __str__(self):
return self.title
\ No newline at end of file
......@@ -31,7 +31,7 @@ ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'bookshelf'
'bookshelf',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
......
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