mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-03 12:47:51 +02:00
Make Document and Image files not nullable
This commit is contained in:
22
ram/bookshelf/migrations/0010_alter_bookimage_image.py
Normal file
22
ram/bookshelf/migrations/0010_alter_bookimage_image.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Generated by Django 4.2.6 on 2023-11-04 22:53
|
||||
|
||||
import bookshelf.models
|
||||
from django.db import migrations, models
|
||||
import ram.utils
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("bookshelf", "0009_alter_bookimage_image"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="bookimage",
|
||||
name="image",
|
||||
field=models.ImageField(
|
||||
storage=ram.utils.DeduplicatedStorage,
|
||||
upload_to=bookshelf.models.book_image_upload,
|
||||
),
|
||||
),
|
||||
]
|
@@ -98,8 +98,6 @@ class BookImage(Image):
|
||||
image = models.ImageField(
|
||||
upload_to=book_image_upload,
|
||||
storage=DeduplicatedStorage,
|
||||
null=True,
|
||||
blank=True
|
||||
)
|
||||
|
||||
|
||||
|
20
ram/metadata/migrations/0016_alter_decoderdocument_file.py
Normal file
20
ram/metadata/migrations/0016_alter_decoderdocument_file.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 4.2.6 on 2023-11-04 22:53
|
||||
|
||||
from django.db import migrations, models
|
||||
import ram.utils
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("metadata", "0015_alter_company_logo_alter_decoder_image_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="decoderdocument",
|
||||
name="file",
|
||||
field=models.FileField(
|
||||
storage=ram.utils.DeduplicatedStorage(), upload_to="files/"
|
||||
),
|
||||
),
|
||||
]
|
@@ -1,4 +1,4 @@
|
||||
from ram.utils import git_suffix
|
||||
|
||||
__version__ = "0.9.4"
|
||||
__version__ = "0.9.5"
|
||||
__version__ += git_suffix(__file__)
|
||||
|
@@ -11,8 +11,6 @@ class Document(models.Model):
|
||||
file = models.FileField(
|
||||
upload_to="files/",
|
||||
storage=DeduplicatedStorage(),
|
||||
null=True,
|
||||
blank=True,
|
||||
)
|
||||
private = models.BooleanField(default=False)
|
||||
|
||||
@@ -34,7 +32,8 @@ class Document(models.Model):
|
||||
class Image(models.Model):
|
||||
order = models.PositiveIntegerField(default=0, blank=False, null=False)
|
||||
image = models.ImageField(
|
||||
upload_to="images/", storage=DeduplicatedStorage, null=True, blank=True
|
||||
upload_to="images/",
|
||||
storage=DeduplicatedStorage,
|
||||
)
|
||||
|
||||
def image_thumbnail(self):
|
||||
|
@@ -0,0 +1,29 @@
|
||||
# Generated by Django 4.2.6 on 2023-11-04 22:53
|
||||
|
||||
from django.db import migrations, models
|
||||
import ram.utils
|
||||
import roster.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("roster", "0020_alter_rollingstockimage_image"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="rollingstockdocument",
|
||||
name="file",
|
||||
field=models.FileField(
|
||||
storage=ram.utils.DeduplicatedStorage(), upload_to="files/"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="rollingstockimage",
|
||||
name="image",
|
||||
field=models.ImageField(
|
||||
storage=ram.utils.DeduplicatedStorage,
|
||||
upload_to=roster.models.rolling_stock_image_upload,
|
||||
),
|
||||
),
|
||||
]
|
@@ -153,8 +153,6 @@ class RollingStockImage(Image):
|
||||
image = models.ImageField(
|
||||
upload_to=rolling_stock_image_upload,
|
||||
storage=DeduplicatedStorage,
|
||||
null=True,
|
||||
blank=True,
|
||||
)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user