you might want to do this 'work' when the user actually requests the page in question, not when you generate the one he is looking at.

for example have 2 views defined in urls.py

getnext/(object-id)/
getprev/(object-id)/

and have these 2 views do the calculation on what is 'next' and issue the 301 redirect's to the real url in question.

if you wanted to be really smart you could cache the result so the 2nd person to view the page would get the real url instead of the redirect.

(thats how I would do it)

but then.. I usually aim for the most complex way possible ;-)

regards
ian

On 31/07/2006, at 9:24 AM, SmileyChris wrote:



jcb wrote:
I have a page that lists a bunch of Geolocation objects (using the
generic view list, works great.) I have a detail page
(django.views.generic.list_detail.object_detail) that works great the
same way...displaying one geolocation (with a tiny Google map, nice.)

Perhaps the best way is to not use a generic view list page. Instead,
why don't you make a simple view which can parse the list, adding in
next / prev ids for each item, then return the template.
Then in your list template, add the next/prev ids for each item to the
querystring for each detail link.

Maybe there's another more genius way, but that's how I'd do it :)



--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to