Commit 9a596d3d authored by Washington99's avatar Washington99

Population of Models

Models each have been populated with 15 entries.
parent ed15c686
Pipeline #3020 failed with stages
# Generated by Django 4.1.7 on 2023-03-28 08:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bookshelf', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='books',
name='ISBN',
field=models.CharField(max_length=14),
),
]
......@@ -10,12 +10,15 @@ class Author(models.Model):
bio = models.CharField(max_length = 700)
def __str__(self):
return "{}, {}".format(self.last_name, self.first_name)
return "{} {}".format(self.first_name, self.last_name)
class Books(models.Model):
title = models.CharField(max_length = 50)
author = models.ForeignKey(Author, on_delete = models.CASCADE)
publisher = models.CharField(max_length = 50)
year_published = models.IntegerField()
ISBN = models.CharField(max_length = 13)
ISBN = models.CharField(max_length = 14)
blurb = models.TextField()
def __str__(self):
return "{} ({}, {})".format(self.title, self.author, self.year_published)
\ 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