Hello, I have a photo gallery application, where it is possible to list photos in order, from different search requests (e.g. search by Album, Category, Person, etc).
In the photo_detail page I want to provide prev/next links that take the user forward or backword to the last photo. ie. so what I have is: results = models.Photo.objects.filter(album=myalbum) and: photo.id == XXXX I want to by able to find out what the next photo.id and previous photo.id are, ideally without having to scan through every photo in results. Is this possible? I know I could also use: models.Photo.objects.filter(album=myalbum)[n] However this would seem to mean that the URL in the search results includes n (instead of the photo id), and as such may refer to the wrong photo if the search results change. Any ideas, suggestions? Any better ways of doing this? Thanks. -- Brian May <br...@microcomaustralia.com.au> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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 -~----------~----~----~----~------~----~------~--~---