Skip to content

Commit

Permalink
feat: add meta-field to Template
Browse files Browse the repository at this point in the history
Closes #439
  • Loading branch information
open-dynaMIX committed Nov 1, 2021
1 parent f402a23 commit 27163e8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions document_merge_service/api/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class TemplateFactory(DjangoModelFactory):
engine = Faker("word", ext_word_list=models.Template.ENGINE_CHOICES_LIST)
template = None
group = None
meta = {}

class Meta:
model = models.Template
18 changes: 18 additions & 0 deletions document_merge_service/api/migrations/0003_template_meta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.9 on 2021-11-01 12:34

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("api", "0002_template_group"),
]

operations = [
migrations.AddField(
model_name="template",
name="meta",
field=models.JSONField(default=dict),
),
]
1 change: 1 addition & 0 deletions document_merge_service/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ class Template(models.Model):
template = models.FileField(max_length=1024)
engine = models.CharField(max_length=20, choices=ENGINE_CHOICES_TUPLE)
group = models.CharField(max_length=255, db_index=True, blank=True, null=True)
meta = models.JSONField(default=dict)
1 change: 1 addition & 0 deletions document_merge_service/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class Meta:
"sample_data",
"files",
"disable_template_validation",
"meta",
)


Expand Down

0 comments on commit 27163e8

Please sign in to comment.