Allow books with no authors

This commit is contained in:
2024-11-26 23:22:37 +01:00
parent 32785f321a
commit 41d9338459
3 changed files with 20 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.1.2 on 2024-11-26 22:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookshelf", "0014_book_published"),
]
operations = [
migrations.AlterField(
model_name="book",
name="authors",
field=models.ManyToManyField(blank=True, to="bookshelf.author"),
),
]

View File

@@ -40,7 +40,7 @@ class Author(models.Model):
class Book(BaseModel):
title = models.CharField(max_length=200)
authors = models.ManyToManyField(Author)
authors = models.ManyToManyField(Author, blank=True)
publisher = models.ForeignKey(Publisher, on_delete=models.CASCADE)
ISBN = models.CharField(max_length=17, blank=True) # 13 + dashes
language = models.CharField(