mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 21:27:49 +02:00
Minor admin improvements and remove unique_together deprecated Meta
Also make rolling stock unique per consist
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 5.1.4 on 2025-01-08 22:25
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookshelf", "0019_basebook_price"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterUniqueTogether(
|
||||
name="basebookdocument",
|
||||
unique_together=set(),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name="basebookdocument",
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=("book", "file"), name="unique_book_file"
|
||||
),
|
||||
),
|
||||
]
|
@@ -96,7 +96,12 @@ class BaseBookDocument(Document):
|
||||
|
||||
class Meta:
|
||||
verbose_name_plural = "Documents"
|
||||
unique_together = ("book", "file")
|
||||
constraints = [
|
||||
models.UniqueConstraint(
|
||||
fields=["book", "file"],
|
||||
name="unique_book_file"
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
class BaseBookProperty(PropertyInstance):
|
||||
|
Reference in New Issue
Block a user