Closes #3052: Add Jinja2 support for export templates

This commit is contained in:
Jeremy Stretch
2019-04-08 12:20:24 -04:00
parent 244d5885ab
commit 197b0c5608
9 changed files with 82 additions and 10 deletions

View File

@@ -55,10 +55,17 @@ class RenderedGraphSerializer(serializers.ModelSerializer):
#
class ExportTemplateSerializer(ValidatedModelSerializer):
template_language = ChoiceField(
choices=TEMPLATE_LANGUAGE_CHOICES,
default=TEMPLATE_LANGUAGE_JINJA2
)
class Meta:
model = ExportTemplate
fields = ['id', 'content_type', 'name', 'description', 'template_code', 'mime_type', 'file_extension']
fields = [
'id', 'content_type', 'name', 'description', 'template_language', 'template_code', 'mime_type',
'file_extension',
]
#

View File

@@ -23,6 +23,7 @@ from . import serializers
class ExtrasFieldChoicesViewSet(FieldChoicesViewSet):
fields = (
(ExportTemplate, ['template_language']),
(Graph, ['type']),
(ObjectChange, ['action']),
)