Fix Jinja2 template support for nested variables

This commit is contained in:
Mike Terzo
2017-02-02 08:14:03 -05:00
parent 596f0110f1
commit 89e49d95a6

View File

@@ -4,13 +4,13 @@
"recordsTotal": {{total}}, "recordsTotal": {{total}},
"recordsFiltered": {{total_filtered}}, "recordsFiltered": {{total_filtered}},
"data": [ "data": [
{%- set report_flag = false -%}
{% for report in reports -%} {% for report in reports -%}
{%- if report_flag %},{%- endif %} {%- if not loop.first %},{%- endif -%}
{%- set report_flag = True -%}
[ [
{%- set column_flag = false -%}
{%- for column in columns -%} {%- for column in columns -%}
{%- if column_flag %},{%- endif -%} {%- if not loop.first %},{%- endif -%}
{%- set column_flag = True -%}
{%- if column.type == 'datetime' -%} {%- if column.type == 'datetime' -%}
"<span rel=\"utctimestamp\">{{ report[column.attr] }}</span>" "<span rel=\"utctimestamp\">{{ report[column.attr] }}</span>"
{%- elif column.type == 'status' -%} {%- elif column.type == 'status' -%}