Template variables and tags confusion... (regarding concatenation)

7 views
Skip to first unread message

chefsmart

unread,
Nov 21, 2009, 5:04:39 AM11/21/09
to Django users
Hi,

When I do <tr id="item_{{ product.id }}"> in a template I get <tr
id="item_1"> in the rendered html as expected.

Now I want to do {% cycle '<tr id="item_{{ product.id }}">' '<tr
class="odd" id="item_{{ product.id }}">' %}, but the desired
concatenation does not happen.

How do I achieve what I want?

Regards.

Tim Chase

unread,
Nov 21, 2009, 6:45:49 AM11/21/09
to django...@googlegroups.com
sounds like you want something like

<tr {% cycle "class='odd'" "" %}
id="item_{{ product.id }}">

-tim




chefsmart

unread,
Nov 21, 2009, 8:19:34 AM11/21/09
to Django users
Exactly. Thanks.
Reply all
Reply to author
Forward
0 new messages