On Fri, Nov 25, 2011 at 1:18 PM, marjenni <[email protected]> wrote:
> Hi all,
>  Why does this not work?
>
>    {% for i in numberOfImages %}
>          <tr>
>         <td> {{ images.i}} </td>

It doesn't work because there is no variable interpolation inside a
template tag. That snippet asks for the attribute named 'i' on the
'images' variable.

As an earlier poster said, pass a list of images to output, and then
iterate through that list. If you need the ordinal of where you are in
the list, that is made available by the for tag:

https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#for

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
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