Commit 6db9c8cb authored by Albert Gagalac's avatar Albert Gagalac

Populated Author and Books models

parent b8616515
# Generated by Django 4.1.7 on 2023-03-28 09:25
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookshelf", "0001_initial"),
]
operations = [
migrations.RenameModel(
old_name="Books",
new_name="Book",
),
]
# Generated by Django 4.1.7 on 2023-03-28 10:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookshelf", "0002_rename_books_book"),
]
operations = [
migrations.AlterField(
model_name="book",
name="blurb",
field=models.TextField(default="", max_length=700),
),
]
# Generated by Django 4.1.7 on 2023-03-28 10:39
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookshelf", "0003_alter_book_blurb"),
]
operations = [
migrations.AlterField(
model_name="book",
name="ISBN",
field=models.PositiveIntegerField(
validators=[
django.core.validators.RegexValidator(
"^[0-9]*$", message="Only numbers are allowed"
),
django.core.validators.DecimalValidator(13, 0),
]
),
),
]
# Generated by Django 4.1.7 on 2023-03-28 10:43
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookshelf", "0004_alter_book_isbn"),
]
operations = [
migrations.AlterField(
model_name="book",
name="ISBN",
field=models.CharField(
max_length=13,
validators=[
django.core.validators.RegexValidator(
"^[0-9]*$", message="Only numbers are allowed"
)
],
),
),
]
# Generated by Django 4.1.7 on 2023-03-28 10:55
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookshelf", "0005_alter_book_isbn"),
]
operations = [
migrations.AlterField(
model_name="book",
name="ISBN",
field=models.PositiveIntegerField(
max_length=13,
validators=[
django.core.validators.RegexValidator(
"^[0-9]*$", message="Only numbers are allowed"
),
django.core.validators.MaxValueValidator(9999999999999),
],
),
),
]
# Generated by Django 4.1.7 on 2023-03-28 10:56
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookshelf", "0006_alter_book_isbn"),
]
operations = [
migrations.AlterField(
model_name="book",
name="ISBN",
field=models.PositiveIntegerField(
validators=[
django.core.validators.RegexValidator(
"^[0-9]*$", message="Only numbers are allowed"
),
django.core.validators.MaxValueValidator(9999999999999),
]
),
),
]
# Generated by Django 4.1.7 on 2023-03-28 10:58
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookshelf", "0007_alter_book_isbn"),
]
operations = [
migrations.AlterField(
model_name="book",
name="ISBN",
field=models.PositiveIntegerField(
validators=[
django.core.validators.RegexValidator(
"^[0-9]*$", message="Only numbers are allowed"
),
django.core.validators.MaxValueValidator(
9999999999999, message="Ensure this value has 13 digits"
),
]
),
),
]
from django.db import models
from django.core.validators import RegexValidator, MinLengthValidator, MaxLengthValidator
from django.core.validators import RegexValidator, MaxValueValidator
# Create your models here.
......@@ -22,10 +22,9 @@ class Book(models.Model):
publisher = models.CharField(default="", max_length=100)
ISBN = models.PositiveIntegerField(validators=
[RegexValidator(r'^[0-9]*$',
message='Only numbers are allowed'),
MinLengthValidator(13),
MaxLengthValidator(13)])
blurb = models.TextField(default="", max_length = 200)
message='Only numbers are allowed'),
MaxValueValidator(9999999999999, message="Ensure this value has 13 digits")])
blurb = models.TextField(default="", max_length = 700)
def __str__(self):
return '{}'.format(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