Twisted web templates: do they support loops?
Looking at the (somewhat sparse) docs for twisted web templates: http://twistedmatrix.com/documents/current/web/howto/twisted-templates.html I see no mention of loops, like in Jinja2: {% for item in items %} <sometag>{{item.someproperty}}</sometag> {% endfor %} Is something like this supported? thx Jacek
On 09:43 pm, jacek99@gmail.com wrote:
Looking at the (somewhat sparse) docs for twisted web templates: http://twistedmatrix.com/documents/current/web/howto/twisted- templates.html
I see no mention of loops, like in Jinja2:
{% for item in items %} <sometag>{{item.someproperty}}</sometag> {% endfor %}
Is something like this supported?
See the recently added documentation on just this topic: http://twistedmatrix.com/trac/changeset/32754 Jean-Paul
Could you show a simple with both the XML and the render function? It's not perfectly clear from the new docs how do you define the loop start/end in the template.... Cheers, Jacek On Wed, Oct 12, 2011 at 5:48 PM, <exarkun@twistedmatrix.com> wrote:
On 09:43 pm, jacek99@gmail.com wrote:
Looking at the (somewhat sparse) docs for twisted web templates: http://twistedmatrix.com/documents/current/web/howto/twisted- templates.html
I see no mention of loops, like in Jinja2:
{% for item in items %} <sometag>{{item.someproperty}}</sometag> {% endfor %}
Is something like this supported?
See the recently added documentation on just this topic:
http://twistedmatrix.com/trac/changeset/32754
Jean-Paul
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
On 09:58 pm, jacek99@gmail.com wrote:
Could you show a simple with both the XML and the render function? It's not perfectly clear from the new docs how do you define the loop start/end in the template....
You cannot define the loop in the template. The template can only use a render function with a loop inside it. Jean-Paul
Cheers, Jacek
On Wed, Oct 12, 2011 at 5:48 PM, <exarkun@twistedmatrix.com> wrote:
On 09:43 pm, jacek99@gmail.com wrote:
Looking at the (somewhat sparse) docs for twisted web templates: http://twistedmatrix.com/documents/current/web/howto/twisted- templates.html
I see no mention of loops, like in Jinja2:
{% for item in items %} <sometag>{{item.someproperty}}</sometag> {% endfor %}
Is something like this supported?
See the recently added documentation on just this topic:
http://twistedmatrix.com/trac/changeset/32754
Jean-Paul
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
participants (2)
-
exarkun@twistedmatrix.com
-
Jacek Furmankiewicz