quickly: {{ current_object.id|add:"1" }} but u havent access to methods of next object if it doesn't exist, but you can hardcode a link to object.
2006/12/16, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > > Hey Everyone, > > Wondering if anyone can help me out here. Is it possible to get the > next item in the database (not by date, but by ID). Obviously, I can't > just do this by saying current id +1 as the next item could have been > deleted. > > Ideally, this should be a something which is fetched in the view so I > can just do {{ next_object.get_absolute_url }} in the template (and > obviously for previous too) > > Any help much appreciated. > > Cheers, > O > > > > > --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---