From 41d93384597a93ca2abca9373b246f4aff0fc8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Tue, 26 Nov 2024 23:22:37 +0100 Subject: [PATCH] Allow books with no authors --- .../migrations/0015_alter_book_authors.py | 18 ++++++++++++++++++ ram/bookshelf/models.py | 2 +- ram/ram/__init__.py | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 ram/bookshelf/migrations/0015_alter_book_authors.py diff --git a/ram/bookshelf/migrations/0015_alter_book_authors.py b/ram/bookshelf/migrations/0015_alter_book_authors.py new file mode 100644 index 0000000..d1fbf5c --- /dev/null +++ b/ram/bookshelf/migrations/0015_alter_book_authors.py @@ -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"), + ), + ] diff --git a/ram/bookshelf/models.py b/ram/bookshelf/models.py index 73db9be..46e036b 100644 --- a/ram/bookshelf/models.py +++ b/ram/bookshelf/models.py @@ -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( diff --git a/ram/ram/__init__.py b/ram/ram/__init__.py index afce73c..52f420f 100644 --- a/ram/ram/__init__.py +++ b/ram/ram/__init__.py @@ -1,4 +1,4 @@ from ram.utils import git_suffix -__version__ = "0.13.4" +__version__ = "0.13.5" __version__ += git_suffix(__file__)