List Info

Thread: how to overcome {% if %} limitation




how to overcome {% if %} limitation
country flaguser name
United States
2007-07-31 02:21:35
Hi,

I am very new to django, now I am dealing with templates.
Coming from
JSP, I am suprise that in django we can't do something like
{% if
Events.objects.filter(...).count > 10 %}

Is there a way to do something like that?

Thanks
james


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: how to overcome {% if %} limitation
country flaguser name
United States
2007-07-31 02:48:37
1) (better!) do this in a view. pass a flag 'more_then_10'
to
template.
2) create custom tag.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )