Skip to content
New issue

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

{% set %} doesn't work with objects #307

Closed
fetis opened this issue Oct 22, 2014 · 2 comments
Closed

{% set %} doesn't work with objects #307

fetis opened this issue Oct 22, 2014 · 2 comments

Comments

@fetis
Copy link

fetis commented Oct 22, 2014

This code

{% set obj = {} %}
{% set obj.property = 111 %}

produces an error "Template render error: (....) TypeError: Cannot call method 'charAt' of undefined"

@carljm
Copy link
Contributor

carljm commented Oct 22, 2014

Correct, this doesn't work in Jinja either. {% set %} is for setting variables, not for mutating them.

@ghost
Copy link

ghost commented Aug 2, 2021

One way to do this here: #313 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants