Commit 5f745c95 authored by Julia Anishka's avatar Julia Anishka

changed blurb charfield to textfield

parent 0fab796f
# Generated by Django 3.2 on 2023-03-27 09:29
import bookshelf.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Author',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_name', models.CharField(max_length=50)),
('last_name', models.CharField(max_length=50)),
('age', models.IntegerField(default=0)),
('nationality', models.CharField(max_length=50)),
('bio', models.TextField(max_length=700)),
],
),
migrations.CreateModel(
name='Books',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=70)),
('publisher', models.CharField(max_length=70)),
('year_published', models.IntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1000), django.core.validators.MaxValueValidator(2023)])),
('ISBN', models.CharField(max_length=13, validators=[django.core.validators.MinValueValidator(13), bookshelf.models.verify_int])),
('blurb', models.CharField(max_length=200, validators=[django.core.validators.MinValueValidator(100)])),
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bookshelf.author')),
],
),
]
...@@ -25,7 +25,7 @@ class Books(models.Model): ...@@ -25,7 +25,7 @@ class Books(models.Model):
validators=[MinValueValidator(1000), MaxValueValidator(datetime.now().year)] validators=[MinValueValidator(1000), MaxValueValidator(datetime.now().year)]
) )
ISBN = models.CharField(max_length = 13, validators = [MinValueValidator(13), verify_int]) ISBN = models.CharField(max_length = 13, validators = [MinValueValidator(13), verify_int])
blurb = models.CharField(max_length = 200, validators = [MinValueValidator(100)]) blurb = models.TextField(max_length = 200, validators = [MinValueValidator(100)])
def __str__(self): def __str__(self):
return self.title return self.title
......
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