Closed GoogleCodeExporter closed 9 years ago
This is cool. You can use the automatic reverse relation on the Photo model
(photo_obj.photoset_set.all()) to get
PhotoSets it belongs to, but a next and previous is tricky. We don't store the
photos in anything more than a
ManyToManyField inside PhotoSet models right now. If Flickr exports ordering
properties for photos in a
photoset, it could be done.
If you don't care about the order matching Flickr precisely, a simple loop over
the photoset_set field objects
would work.
Original comment by jesse.l...@gmail.com
on 29 Mar 2009 at 3:45
Ah, yeah, makes sense. What I ended up implementing was rather naive, but works:
photoset = PhotoSet.objects.get(photos=photo)
That's in my view before I render output. Since I know that there won't be a
photo
that belongs to two photosets, it's fairly reliable.
The next / prev also works well as long as I sort the photosets by post date.
See my
implementation here:
http://nywcc.dumbwaiterdesign.com/photos/
Similar YouTube implementation here:
http://nywcc.dumbwaiterdesign.com/videos/
Original comment by intellin...@gmail.com
on 29 Mar 2009 at 4:05
Original comment by jesse.l...@gmail.com
on 15 Apr 2009 at 12:48
Original issue reported on code.google.com by
intellin...@gmail.com
on 26 Mar 2009 at 7:22