On Wed, Jun 10, 2009 at 5:43 PM, Frank Peterson
<fictionalper...@gmail.com>wrote:

>
> I'm on Django 0.91 (unfortunately we are stuck with that and cannot
> upgrade).
>
> We have a variable - object.caption and lets say that it equals
> "Bling: whatever" (without the quotes)
>
> I am doing a hack in the templates (dont have access to anything else,
> and need to output "IT WORKED!" (without the quotes)
>
> I am using the following code
>
> {% ifequal object.caption|lower|truncatewords:"1"|cut:": ..." "bling"
> %}IT WORKED!{% endifequal %}
>
> It gives me "bling" when I output this {{ object.caption|lower|
> truncatewords:"1"|cut:": ..." }}
> however as soon as that code is in the ifequal it errors and says
>
> IFEQUAL takes two arguments error


It has been a long time since Django .91 but if I were to see this error I
would think that object.caption|lower|truncatewords:"1"|cut:": ..." is not
return anything (is there a object.caption that doesn't have a value?) When
you just place {{ object.caption|lower|truncatewords:"1"|cut:": ..." }} what
is displayed? You can also put an if tag around to the ifequal tag to see if
there is a object.caption|lower|truncatewords:"1"|cut:": ..."
I hope that helps,

Michael

--~--~---------~--~----~------------~-------~--~----~
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