Re: how to use "if element in List" from a template?

2008-09-03 Thread TiNo
{% load my_utils %} should work On Wed, Sep 3, 2008 at 11:46 AM, joune <[EMAIL PROTECTED]> wrote: > > Thanks Daniel.. > > Sorry i'm a bit slow (i do this in my spare time) > > I tried what you said, and refered to the doc at > http://docs.djangoproject.com/en/dev/howto/custom-template-tags/ for >

Re: how to use "if element in List" from a template?

2008-09-03 Thread joune
Thanks Daniel.. Sorry i'm a bit slow (i do this in my spare time) I tried what you said, and refered to the doc at http://docs.djangoproject.com/en/dev/howto/custom-template-tags/ for writing custom filters.. so i wrote the code you suggested in my_utils.py, indide a templatetags directory along

Re: how to use "if element in List" from a template?

2008-09-01 Thread Daniel Roseman
On Sep 1, 1:05 pm, joune <[EMAIL PROTECTED]> wrote: > Hi all, > I'm totally new to Django and i'm starting to play with templates... > I have a list to display and a separate list of elements considered > special; > so i'd like to display the first list with a different style if the > element is c

how to use "if element in List" from a template?

2008-09-01 Thread joune
Hi all, I'm totally new to Django and i'm starting to play with templates... I have a list to display and a separate list of elements considered special; so i'd like to display the first list with a different style if the element is contained in the "specials list" for instance: list = [ 'john',