Apart from writing your own for tag, you could, for instance, supply a generator (or equivalent) on your model, or passed in by your view, that returns 3 tuples of (this, prev, next), or perhaps easier to read in the template, toy objects having this, prev, and next attributes (or properties).
On Mon, Mar 7, 2011 at 3:43 PM, Ariel <[email protected]> wrote: > Could you give some idea ??? > I am sorry about the previous message I had not finished. > Any help is appreciated. > Regards. > > On Mon, Mar 7, 2011 at 3:39 PM, Ariel <[email protected]> wrote: >> >> Hi everybody: >> >> I would want to know in the django template tags how to get the next and >> the previous element when I am iterating in the forloop, I haven't found >> something similar, for instance I would want something like this: >> {% for element in list_elements %} >> {{forloop.get_prev_element.title}} >> {{forloop.get_next_element.title}} > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to [email protected]. > 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. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. 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.

