Re: Iterating over model instances ordered_with_respect_to in templates

2010-07-22 Thread Marek Dudek
I found solution but very inefficient one: {% with gallery.get_pictureingallery_order as ids_in_order %} {% for picture_in_gallery_id in ids_in_order %} {% for picture_in_gallery in gallery.pictureinga

Iterating over model instances ordered_with_respect_to in templates

2010-07-21 Thread Marek Dudek
Hello I have two models and 1-to-many relation between them, using ForeignKey (gallery with pictures). Additionally instances on 'many' side are ordered_with_respect_to owning instance. I need to iterate over them in template, respecting imposed order. I can use "get_pictureingallery_order" o