Re: TemplateSyntaxError: 'if' statement improperly formatted
Its also important to use {% endifequal %} So...went passing to HTML templates {% ifequal rowvalue "Blue" %} Its Blue {% endifequal %} L. On Sunday, 3 January 2010 17:34:22 UTC, Biju Varghese wrote: > > hi >If you want to compare the value you have to use ifequal or > ifnotequal tag in template language. if you use "if" > this will check only weather the variable is empty or not > -- 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/-/UAs8OTCpgI0J. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: TemplateSyntaxError: 'if' statement improperly formatted
hi If you want to compare the value you have to use ifequal or ifnotequal tag in template language. if you use "if" this will check only weather the variable is empty or not -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: TemplateSyntaxError: 'if' statement improperly formatted
On Jan 2, 2010, at 8:54 PM, Ramiro Morales wrote: > On Sat, Jan 2, 2010 at 10:33 PM, dhruvg wrote: >> >> Could you elaborate? >> The documentation indicates that complex expressions follow Python >> exactly. > > I suspect you are using django 1.1.x and reading theDjango SVN trunk > documentation. > > -- > Ramiro Morales | http://rmorales.net > Yeah, sorry. I linked you to the trunk page. Try this one: http://docs.djangoproject.com/en/1.1/ref/templates/builtins/ Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: TemplateSyntaxError: 'if' statement improperly formatted
On Sat, Jan 2, 2010 at 10:33 PM, dhruvg wrote: > > Could you elaborate? > The documentation indicates that complex expressions follow Python > exactly. I suspect you are using django 1.1.x and reading theDjango SVN trunk documentation. -- Ramiro Morales | http://rmorales.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: TemplateSyntaxError: 'if' statement improperly formatted
Could you elaborate? The documentation indicates that complex expressions follow Python exactly. or and not in ==, !=, <, >,``<=``, >= (This follows Python exactly). So, for example, the following complex if tag: {% if a == b or c == d and e %} ..will be interpreted as: (a == b) or ((c == d) and e) On Jan 2, 5:28 pm, Shawn Milochik wrote: > The problem is that you're using Python syntax instead of template tags. > > http://docs.djangoproject.com/en/dev/ref/templates/builtins/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: TemplateSyntaxError: 'if' statement improperly formatted
The problem is that you're using Python syntax instead of template tags. http://docs.djangoproject.com/en/dev/ref/templates/builtins/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
TemplateSyntaxError: 'if' statement improperly formatted
{% if total_feed_approvals != 0 or total_dataset_approvals != 0 %} {% endif %} what is wrong with the above statement? i have tried it with quotes around the 0 like "0" and that doesn't help. is it because there is an 'or'? i think complex expressions are allowed in django. thanks in advance. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.