Re: How to format the "value" attribute of an option in a Select List using the template language for loop

2011-03-16 Thread werefr0g
Well... here is the lin (right into the relevant section) : http://docs.djangoproject.com/en/dev/ref/templates/builtins/#for -- 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

Re: How to format the "value" attribute of an option in a Select List using the template language for loop

2011-03-16 Thread werefr0g
Sorry again, Actually, the doc tell us the way [1]. Simply use {{ forloop.counter }} or {{ forloop.counter0 }}. Regards, -- 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

Re: How to format the "value" attribute of an option in a Select List using the template language for loop

2011-03-16 Thread werefr0g
Hi, You'll probably need to prepare the "options" in your view; with enumerate(), for example (paginator may be a little too much, sorry). Regards, [1] http://docs.python.org/library/functions.html#enumerate Le 16/03/2011 04:18, Juan Gabriel Aldana Jaramillo a écrit : Hi, Check this

Re: How to format the "value" attribute of an option in a Select List using the template language for loop

2011-03-15 Thread Juan Gabriel Aldana Jaramillo
Hi, Check this link. http://www.djangobook.com/en/2.0/chapter19/ I think this is an example about what you are looking for: ** *{% for lang in LANGUAGES %} {{ lang.1 }} {% endfor %}*** On Tue, Mar 15, 2011 at 3:04 PM, werefr0g

Re: How to format the "value" attribute of an option in a Select List using the template language for loop

2011-03-15 Thread werefr0g
Hello, If you use a paginator [1], you'll prepare the "index number" in the view but this will provide all the context you need in your template. Regards, [1] http://docs.djangoproject.com/en/dev/topics/pagination/ -- You received this message because you are subscribed to the Google Groups

How to format the "value" attribute of an option in a Select List using the template language for loop

2011-03-15 Thread hank23
I'm trying to figure out how to code the template language to assign an index number to the "value" attribute of an option in a select list, as I build the option list using a for loop. I can't seem to find any examples of doing this in the django documentation. So is this done automatically by