Strange (atleast for me) behavior in Django template

Posted by lud0h on Stack Overflow See other posts from Stack Overflow or by lud0h
Published on 2010-05-27T10:58:58Z Indexed on 2010/05/27 11:01 UTC
Read the original article Hit count: 184

Filed under:
|
|

The following code snippet in a Django template (v 1.1) doesn't work.
{{ item.vendors.all.0 }} ==> returns "Test"

but the following code snippet, doesn't hide the paragraph!

{% ifnotequal item.vendors.all.0 "Test" %}
<p class="view_vendor">Vendor(s): {{item.vendors.all.0}} </p><br />
{% endifnotequal %}

Any tips on what's wrong?

Thanks.

© Stack Overflow or respective owner

Related posts about python

Related posts about django