Thanks. With results.items, both solutions work on the svn current
version.

The variable value is a list. I would like each key,value to be in a
separate row.

        {% for key, values in results.items %}
         {% for value in values %}
          <tr>
            <td>{{ key }}</td>
            <td>{{ value }}</td>
          </tr>
         {% endfor %}
        {% endfor %}

This causes the same key to showup on all the rows associated with it.
Is there a way to use html's colspan to have the key cell span all
rows associated with it?

thanks,
Ravi.

On Apr 27, 4:26 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sun, 2008-04-27 at 13:35 -0500, Alex Ezell wrote:
>
> [...]
>
> > Depending on the version of Django you are using, you should be able to do 
> > this:
>
> > {% for key, value in results %}
> >   <tr>
> >     <td>{{ key }}</td>
> >     <td>{{ value }}</td>
> >   </tr>
> > {% endfor %}
>
> Or, for older versions:
>
>         {% for item in results.items %}
>           <tr>
>             <td>{{ item.0 }}</td> {# key #}
>             <td>{{ item.1 }}</td> {# value #}
>           </tr>
>         {% endfor %}
>
> (by the way, the original example should have used results.items, too.)
>
> Regards,
> Malcolm
>
> --
> How many of you believe in telekinesis? Raise my 
> hand...http://www.pointy-stick.com/blog/
--~--~---------~--~----~------------~-------~--~----~
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