just a guess.
for the first image:
{% for image in object.images.all.0 %}
...
and for the rest:
{% for image in object.images.all %}
{% if not forloop.first %}
...
note: what you described here (object.images.all) is not a foreignkey
but a m2m-relationship.
patrick.
Am 09.05.2007 um 14:52 schrieb Alessandro Ronchi:
>
> I have an item in my model with one or more photos, linked by a
> foreign key.
> I want to put in my template the first image at the head of the page,
> and the second in another place.
>
> The result i need is that:
> iiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxx
> iiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiiii
> xxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiiii
> xxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiiii
>
> where x is text and i is image
> and so on.
>
> I can't use the default
> {% for image in object.images.all %}
> <img alt="{{image.name}}" src="{% filter thumbnail:"width=200"
> %}{{image.get_image_url}}{% endfilter %}" />
> {% endfor %}
>
> because it gets all the images.
>
> Is it possible to select the first, the second and so on image of the
> list object.images.all ?
> --
> Alessandro Ronchi
> Skype: aronchi - Wengo: aleronchi
> http://www.alessandroronchi.net - Il mio sito personale
> http://www.soasi.com - Sviluppo Software e Sistemi Open Source
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---