jinja2 UndefinedError:No caller defined
<p>Recently I have written something using jinja2 and I am a beginner.I encounter some problems when I try to write some html using jinja2.
codes shows like this:</p>

<pre><code>{% macro input2(users) -%}
    &lt;ul&gt;
    {%- for user in users %}
      &lt;li&gt;&lt;p&gt;{{ caller(user) }}&lt;/p&gt;&lt;/li&gt;
    {%- endfor %}
    &lt;/ul&gt;
{%- endmacro %}
{% call(user) input2(users) %}
    user
{% endcall %}
</code></pre>

<p>And When I use {{ input2(users) }} to call the macro input2,it tells me that </p>

<pre><code> &lt;li&gt;&lt;p&gt;{{ caller(user) }}&lt;/p&gt;&lt;/li&gt;

UndefinedError:No caller defined.
</code></pre>

<p>I want to know why?
Many thanks.</p>