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:
<form action="/i18n/setlang/" method="post">
<input name="next" type="hidden" value="/next/page/" />
_<select name="language">_
_{% for lang in LANGUAGES %}
<option value="{{ lang.0 }}">{{ lang.1 }}</option>
{% endfor %}_
_</select>_
<input type="submit" value="Go" />
</form>
On Tue, Mar 15, 2011 at 3:04 PM, werefr0g <weref...@yahoo.fr
<mailto:weref...@yahoo.fr>> 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
<mailto:django-users@googlegroups.com>.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com
<mailto:django-users%2bunsubscr...@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.