Re: comparing custom template tag within if tag

2012-03-30 Thread Tom Evans
On Thu, Mar 29, 2012 at 5:42 PM, Nikhil Verma wrote: > Hi All > > I am still not able to solve this problem .Any more suggestions ? > > Thanks > Because there is no solution. You must rewrite the custom tag to set a variable in the context, which you can then test in your 'if' tag. The link in m

Re: comparing custom template tag within if tag

2012-03-29 Thread Nikhil Verma
Hi All I am still not able to solve this problem .Any more suggestions ? Thanks On Thu, Mar 29, 2012 at 10:03 PM, Tom Evans wrote: > On Thu, Mar 29, 2012 at 5:22 PM, Josh Cartmell > wrote: > > I think something like this would work: > > {% with price_for_pax service pax '' as pfp %} > > It wo

Re: comparing custom template tag within if tag

2012-03-29 Thread Tom Evans
On Thu, Mar 29, 2012 at 5:22 PM, Josh Cartmell wrote: > I think something like this would work: > {% with price_for_pax service pax '' as pfp %} It won't. The {% with %} tag cannot arbitrarily call custom tags. Cheers Tom -- You received this message because you are subscribed to the Google G

Re: comparing custom template tag within if tag

2012-03-29 Thread Josh Cartmell
I think something like this would work: {% with price_for_pax service pax '' as pfp %} {% if service.price == pfp %} do something {% endif %} {% endwith %} Alternatively if price_for_pax is only used for comparing to service.price you could have it return true or false based on whether whatever

Re: comparing custom template tag within if tag

2012-03-29 Thread Tom Evans
On Wed, Mar 28, 2012 at 4:59 PM, Nikhil Verma wrote: > Hi all > > i have a custom template tag that takes some argument and calculates the > result. > I want to compare that value obtained from that custom tag with another > variable. > > Custom template tag > {% price_for_pax service pax '' %} >

comparing custom template tag within if tag

2012-03-28 Thread Nikhil Verma
Hi all i have a custom template tag that takes some argument and calculates the result. I want to compare that value obtained from that custom tag with another variable. Custom template tag {% price_for_pax service pax '' %} variable : {{service.price}} What i want is {% if service.price == pr