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 unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 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 > wrote:


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 "Django users" group.
To post to this group, send email to django-users@googlegroups.com
.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.


--
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


--
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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  wrote:

>  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
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.