Hey all, I'm having a problem getting ifnotequal logic to work.

I have what is basically this layout:

{% ifnotequal activeusers|length 0 %}
    {{ activeusers|length }} Friends Online
{% else %}
    Friends
{% endifnotequal %}

in one of my templates. Its not quite as simple as that, theres some
list elements and CSS classing going on so that the element appears
greyed out whenever activeusers|length is 0. Or at least its supposed
to, but it doesn't, because this ALWAYS seems to be output the first
condition and not the else. So if theres 1 or more, it'll say "n
Friends Online", but even when there are 0, it'll say "0 Friends
Online" instead of saying simply "Friends".

So I know that activeusers|length is output as 0, however for some
reason its saying that that output doesn't equal 0.

At first I thought maybe the length filter needed to be compared to
"0" instead of 0, but that didn't work either. Is there some logical
problem I'm missing or does Django just have a problem dealing with
zero values in conditional statements?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to