mirror of
https://github.com/daniviga/django-ram.git
synced 2025-10-19 09:00:32 +02:00
Minor admin improvements and remove unique_together deprecated Meta
Also make rolling stock unique per consist
This commit is contained in:
@@ -156,8 +156,13 @@ class RollingStockDocument(Document):
|
||||
RollingStock, on_delete=models.CASCADE, related_name="document"
|
||||
)
|
||||
|
||||
class Meta(object):
|
||||
unique_together = ("rolling_stock", "file")
|
||||
class Meta:
|
||||
constraints = [
|
||||
models.UniqueConstraint(
|
||||
fields=["rolling_stock", "file"],
|
||||
name="unique_stock_file"
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
def rolling_stock_image_upload(instance, filename):
|
||||
|
Reference in New Issue
Block a user