mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 21:27:49 +02:00
Add documents to decoders (#22)
* Add decoder documents support * Use abstract model for Documents * Increase version * Code cleanup
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
# Generated by Django 4.2 on 2023-09-30 21:54
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import ram.utils
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("metadata", "0011_company_slug_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="decoder",
|
||||
name="manufacturer",
|
||||
field=models.ForeignKey(
|
||||
limit_choices_to={"category": "accessory"},
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="metadata.manufacturer",
|
||||
),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="DecoderDocument",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("description", models.CharField(blank=True, max_length=128)),
|
||||
(
|
||||
"file",
|
||||
models.FileField(
|
||||
blank=True,
|
||||
null=True,
|
||||
storage=ram.utils.DeduplicatedStorage(),
|
||||
upload_to="files/",
|
||||
),
|
||||
),
|
||||
(
|
||||
"decoder",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="document",
|
||||
to="metadata.decoder",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"unique_together": {("decoder", "file")},
|
||||
},
|
||||
),
|
||||
]
|
Reference in New Issue
Block a user