Open shaunpatterson opened 8 years ago
I'm afraid that currently you're stuck; you either need to turn off jinja compat, or name the attribute something other than items
.
I'd be open to proposals for how to change this behavior in the jinja compat layer. If we were aiming for even better compatibility with Jinja, we'd copy the behavior described in the "Implementation" callout box here: http://jinja.pocoo.org/docs/dev/templates/#variables That is, we'd have .foo
and ['foo']
perform slightly different lookups, where in the former case the method would be returned and in the latter case the data member would be.
I'll accept this ticket as a feature request for that behavior; PR welcome!
I have a json object with:
However, I have jinja2 compatibility on (which I'll have to evaluate if I can turn off..).
Is returning the function items()
does the same
Is there some way of accessing
items
without turning off Jinja2 compat?