We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I got a error message as the following lines when I put {%tr ... %} tag inside a normal for loops:
{%tr ... %}
Encountered unknown tag 'tr'. Jinja was looking for the following tags: 'endfor' or 'else'. The innermost block that needs to be closed is 'for'.
My template
{% for data_detail in context.data_details %} {{ data_detail.data_name }} ---------------------------------------- | Field | Description | Remark| | {%tr for data_field in data_detail.data_fields %} | | ---------------------------------------- | | {{ data_field.field }} | {{data_field.description}} | {{data_field.remark}} | | ---------------------------------------- | | {%tr endfor %} | ---------------------------------------- | {%- end for %}
My context is listed below:
"contexts": [ ... "data_details": [ { "data_name": "DI List frame", "data_fields": [ { "field": "DI No.", "description": "DI No", "remark": "Display field" }, { "field": "Picking Slip No.", "description": "Picking Slip No.", "remark": "Display field" } ] }, ...
The text was updated successfully, but these errors were encountered:
You have not given the whole data, but context.data_details requires there is another outer nested for-loop isn't it ?
context.data_details
Sorry, something went wrong.
Original data is too large to give, so I ignore it. It looks like
context = { "contexts": [ { "heading": "Picking Slip Production", "modules": ["shjjL0400.jsp", "~rest.ssjcRestL0400"], "instructions": [ ,,, ] }, { "heading": "...", ,,, } ]
So there is a normal for loop outer of the table, such as
{% for context in contexts %} ... {% endfor %}
could you try without the dash in {%- endfor %}
No branches or pull requests
Describe your problem
I got a error message as the following lines when I put
{%tr ... %}
tag inside a normal for loops:More details about your problem
My template
Provide a test case
My context is listed below:
Screenshots
The text was updated successfully, but these errors were encountered: