Commit 3fbdeee5 authored by Rafa Mendoza's avatar Rafa Mendoza

fixed the foreignkey

parent a6f55ba4
from django.db import models
# -- coding: UTF-8 --
class Author(models.Model):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
age = models.IntegerField()
nationality = models.CharField(max_length=50)
bio = models.CharField(max_length=700)
class Books(models.Model):
title = models.CharField(max_length=125)
author = models.ForeignKey(Author, on_delete=models.CASCADE)
publisher = models.CharField(max_length=100)
year_published = models.IntegerField(max_length=100)
isbn = models.CharField(max_length=13)
blurb = models.TextField()
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