I have a quite simple query set and a related generic views:

f_detail = {
         'queryset': Foto.objects.all(),
         'template_name': 'foto_dettaglio.html',
         "template_object_name" : "foto",
       }

urlpatterns = patterns('',
# This very include
(r'^foto/(?P<object_id>\d+)/$', list_detail.object_detail, f_detail, ),
)

Just a template for generating a detail page of a photo: so there's no view.


Is there an easy way to have a link to previous | next element in the template without manualy coding a view ?

Somthing like a:

{% if foto.next_item %} 
  <a href="/path/foto/{{ foto.next_item.id_field }}/">Next</a> 
{% endif}
Edit
Report