'ifequal' takes two arguments

169 views
Skip to first unread message

Bradley Hintze

unread,
Sep 22, 2010, 11:48:45 AM9/22/10
to django...@googlegroups.com
I am getting an ''ifequal' takes two arguments' error for this line:

{% ifequal {{ param2_trunc_new.3.0 }} {{ param2.4.1 }} %}

I believer those are indeed two arguments. What going on here?

--
Bradley J. Hintze
Graduate Student
Duke University
School of Medicine
801-712-8799

Shawn Milochik

unread,
Sep 22, 2010, 11:52:58 AM9/22/10
to django...@googlegroups.com
Try writing both values to the screen or standard out.

It's always possible that one of them isn't being populated.


Shawn Milochik

unread,
Sep 22, 2010, 11:53:54 AM9/22/10
to django...@googlegroups.com
Oh, and you don't have a space between those two variables, so it could be that they're running together and appear to be a single one.

Daniel Roseman

unread,
Sep 22, 2010, 12:09:35 PM9/22/10
to Django users
On Sep 22, 4:48 pm, Bradley Hintze <bradle...@aggiemail.usu.edu>
wrote:
> I am getting an ''ifequal' takes two arguments' error for this line:
>
> {% ifequal {{ param2_trunc_new.3.0 }} {{ param2.4.1 }} %}
>
> I believer those are indeed two arguments. What going on here?
>
> --
> Bradley J. Hintze

Don't put arguments within variable delimiters:

{% ifequal param2_trunc_new.3.0 param2.4.1 %}

In any case, in Django 1.2+ you can do this:

{% if param2_trunc_new.3.0 != param2.4.1 %}

--
DR.
Reply all
Reply to author
Forward
0 new messages