im really struggling to work out how to phrase this question, which is
why i've had zero luck googling it. i'll try and explain it.

ive got two models.

car and photo in a one to many relationship.

my queryset is bringing back all of the photos and the for loop writes
them all out. currently the photos come back in order of addition,
since all i've got to sort them on is added_date. (i tried ordering
the photos by the FK which is car.name but that didn't work).

so what i'd really like to do, is order the photos in order of the
primary key, ie make sure that even if there were two pics of a  911
added either side of an Enzo, the query will group all 911's together,
then all Enzos together.

finally when i write out the vehicles, i'd like to write a different
line for the first of each type of vehicle. to explain that, the
output should be an image linked to a fancybox gallery. because of the
amount of different vehicles, i'd like to only show one image of each
vehicle, but the fancybox js gallery will allow me to show the rest.

hope that makes sense.

anyone got any links to something that explains how to fix this?

it occured to me that what i should be, was to be grabbing a query set
containng all of the vehicles, then in the template going back and
getting the images belonging to each car as i went through my for
loop. is that feasible?

Matt

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

Reply via email to