Wednesday, July 25, 2012

Problem on 'if' on templates

Hello, beginner here. I'm getting an error at the IF statement, line 2 of this snippet:

{% for object in object.list|slice:":5" %}
           {% if object.person == "String" and forloop.counter0 == 5 %}
        <tr>
            <td bgcolor="{{ object.color_bg }}"  style="padding: 8px;"></td>
        </tr>
        {% else %}
        <tr>
            <td bgcolor="{{ object.color }}"  style="padding: 8px;"><a href="{% url paper paper=object.paper.id %}">{{ object.paper }}</a> </td>
        </tr>
        {% endif %}
 {% endfor %}

This must be something simple.. glad for any help .

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Ju4mQOW4-csJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment