PS: what i want to prevent is having to test everywhere i use object
members, e.g.:
{% if person and person.0 and person.0.age %}{{ person.0.age > 18 }}{%
endif %}
Or is this "the only right way"TM ?
tia
best regards,
Jeroen
On Aug 31, 1:42 pm, Jeroen Dierckx <[email protected]> wrote:
> Hi all,
>
> I have a question about the differences between jinja1 and jinja2
> concerning undefined behavior.
> How would one mimic the same behavior in jinja2 as it was in jinja1 ?
> I assume by implementing an Undefined class and passing it to the
> environment, but what and how does this class have to implement?
>
> What i have now is this:http://paste.pocoo.org/show/467672/
> That's the undefined implementation and how i pass it to the
> environment, but i want it to fail silently on method calls too, like
> jinja1 … :s
>
> I know Armin sees this as a design mistake, but switching a legacy
> system from jinja1 to jinja2 has gotten me in trouble concerning the
> undefined behavioral change .
>
> Thanks in advance for any help.
>
> Best regards,
> Jeroen
--
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pocoo-libs?hl=en.