Commit d17a8576 authored by KaoruSawade's avatar KaoruSawade

Altered books model to use CharField instead of IntegerField for the...

Altered books model to use CharField instead of IntegerField for the publishing year, populated models with 15 records each
parent 1ed648cb
# Generated by Django 4.1.7 on 2023-03-27 10:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bookshelf', '0002_rename_book_books'),
]
operations = [
migrations.AlterField(
model_name='books',
name='year_published',
field=models.PositiveIntegerField(default='', null=True),
),
]
# Generated by Django 4.1.7 on 2023-03-27 10:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bookshelf', '0003_alter_books_year_published'),
]
operations = [
migrations.AlterField(
model_name='books',
name='ISBN',
field=models.CharField(default='', max_length=13, null=True, unique=True),
),
]
......@@ -14,8 +14,8 @@ class Books(models.Model):
title = models.CharField(max_length=300, default="")
author = models.ForeignKey(Author, on_delete=models.CASCADE)
publisher = models.CharField(max_length=300, default="")
year_published = models.DateField(null=True, default="")
ISBN = models.IntegerField(unique=True, null=True, default="")
year_published = models.PositiveIntegerField(null=True, default="")
ISBN = models.CharField(unique=True, null=True, max_length=13, default="")
blurb = models.TextField()
def __str__(self):
......
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