Skip to content
Myr

use "Jinja" instead of "Jinja2"

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent 1af1205 · Browse files · 3 files+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+6 added−6 removed

  • other:+6 added−6 removed

3 files+6 added−6 removed

modified:docs/sandbox.rst+1 added-1 removed
73 unmodified lines
74will use the :attr:`SandboxedEnvironment.binop_table` to translate75operator symbols into callbacks performing the default operator behavior.7677This example shows how the power (``**``) operator can be disabled in78Jinja2::78Jinja::7980 from jinja2.sandbox import SandboxedEnvironment8182
12 unmodified lines
modified:docs/switching.rst+4 added-4 removed
122 unmodified lines
123argument passing is different. A template that looks like this in Django::124125 {{ items|join:", " }}126127looks like this in Jinja2::127looks like this in Jinja::128129 {{ items|join(', ') }}130131It is a bit more verbose, but it allows different types of arguments -
25 unmodified lines
157 {% empty %}158 No items!159 {% endfor %}160161...looks like this in Jinja2::161...looks like this in Jinja::162163 {% for item in items %}164 {{ item }}165 {% else %}
2 unmodified lines
168169Cycle170~~~~~171172The ``{% cycle %}`` tag does not exist in Jinja2; however, you can achieve the172The ``{% cycle %}`` tag does not exist in Jinja; however, you can achieve the173same output by using the `cycle` method on the loop context special variable.174175The following Django template::176177 {% for user in users %}178 <li class="{% cycle 'odd' 'even' %}">{{ user }}</li>179 {% endfor %}180181...looks like this in Jinja2::181...looks like this in Jinja::182183 {% for user in users %}184 <li class="{{ loop.cycle('odd', 'even') }}">{{ user }}</li>185 {% endfor %}
41 unmodified lines
modified:jinja2/compiler.py+1 added-1 removed
519 unmodified lines
520521 undeclared = find_undeclared(node.body, ('caller', 'kwargs', 'varargs'))522523 if 'caller' in undeclared:524 # In older Jinja2 versions there was a bug that allowed caller524 # In older Jinja versions there was a bug that allowed caller525 # to retain the special behavior even if it was mentioned in526 # the argument list. However thankfully this was only really527 # working if it was the last argument. So we are explicitly528 # checking this now and error out if it is anywhere else in
1205 unmodified lines