Skip to content

Commit

Permalink
Switch from Django to Jinja2 templates in "data" plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ohinckel committed Nov 8, 2023
1 parent 955098c commit 1bc003f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions config/plugins/sources/data.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import logging

from django.db import models
from django.template import Context, Template
from django.template import Context
from jinja2 import Template

from framarama.base import forms as base
from config.models import SourceStep
Expand Down Expand Up @@ -78,7 +79,7 @@ def run(self, model, data_in, ctx):
if model.template_out:
_template = Template(model.template_out)
_data_out_dict = _data_out.get_as_dict()
_output = _template.render(Context({'data': _data_out_dict.get() if _data_out_dict else {}}))
_output = _template.render(data=_data_out_dict.get() if _data_out_dict else {})

_data_out = data.DataContainer(data=_output, data_type=data.DataType(data.DataType.MIME, model.mime_out))

Expand Down

0 comments on commit 1bc003f

Please sign in to comment.