Add default_metadata in DocumentType
This commit is contained in:
parent
be450c59d7
commit
b686e3762b
@ -0,0 +1,24 @@
|
|||||||
|
# Generated by Django 4.1.7 on 2023-07-23 17:36
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('documents', '1036_add_metadata'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='documenttype',
|
||||||
|
name='default_metadata',
|
||||||
|
field=models.JSONField(blank=True, help_text='Default JSON metadata', null=True, verbose_name='default_metadata'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='metadata',
|
||||||
|
name='document',
|
||||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='document', to='documents.document', verbose_name='document'),
|
||||||
|
),
|
||||||
|
]
|
@ -112,6 +112,14 @@ class Tag(MatchingModel):
|
|||||||
|
|
||||||
|
|
||||||
class DocumentType(MatchingModel):
|
class DocumentType(MatchingModel):
|
||||||
|
default_metadata = models.JSONField(
|
||||||
|
_("default_metadata"),
|
||||||
|
# Source: https://stackoverflow.com/a/47590145/5575610
|
||||||
|
null=True,
|
||||||
|
blank=True,
|
||||||
|
help_text=_("Default JSON metadata"),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta(MatchingModel.Meta):
|
class Meta(MatchingModel.Meta):
|
||||||
verbose_name = _("document type")
|
verbose_name = _("document type")
|
||||||
verbose_name_plural = _("document types")
|
verbose_name_plural = _("document types")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user