Commit 46ad5957 authored by Jan Enzo Salvador's avatar Jan Enzo Salvador

Edited wrong syntax

parent a3469ef0
from django.db import models from django.db import models
class Author(models.model): class Author(models.Model):
first_name = models.CharField(max_length = 50, default = "") first_name = models.CharField(max_length = 50, default = "")
last_name = models.CharField(max_length = 30, default = "") last_name = models.CharField(max_length = 30, default = "")
age = models.IntegerField(default = 0) age = models.IntegerField(default = 0)
nationality = models.CharField(max_length = 30, default = "") nationality = models.CharField(max_length = 30, default = "")
bio = models.TextField(max_length = 700, default = "") bio = models.TextField(max_length = 700, default = "")
class Books(models.model): class Books(models.Model):
title = models.CharField(max_length = 50, default = "") title = models.CharField(max_length = 50, default = "")
author = models.ForeignKey(Author, on_delete = models.CASCADE) author = models.ForeignKey(Author, on_delete = models.CASCADE)
publisher = models.CharField(max_length = 50, default = "") publisher = models.CharField(max_length = 50, 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