On Fri, 2008-07-25 at 03:42 -0700, Ryan wrote:
> thank you kenneth and jukien
> 
> this is what I tried on the python prompt. I was not sure where to run
> the snippet.
> from django import template
> register = template.Library()
> @register.filter
> def LT(value,arg): return value < arg
> 
> But when I run the template
> {%if forloop.counter|LT:3 %}
> 
> I get the following error.
> Invalid filter: 'LT'.
> 
> I am not sure if what I am doing is wrong or right.
> Could anybody suggest something about this.

You need to follow the procedure documented here to load these filters:

http://www.djangoproject.com/documentation/templates_python/#extending-the-template-system




--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to