2007/3/23, Greg Donald <[EMAIL PROTECTED]>:
>
> I have some tuples like this:
>
> categories = ( ( 'a', 'abc' ), ( 'b', 'def' ) )
>
> How can I build select options from that in a template?
>
> When I try this:
>
> {% for c in categories %}
> <option value="{{ c[0] }}">{{ c[1] }}</option>
> {% endfor %}

Try:

<option value="{{c|slice:":1"|first}}">{{c|slice:"1:2"|first}}</option>

Regards.

-- 
Marcelo Ramos
Fedora Core 6 | 2.6.19
Socio UYLUG Nro 125

--~--~---------~--~----~------------~-------~--~----~
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