You probably want to look at this: http://www.djangoproject.com/documentation/models/pagination/
On Tue, 2007-10-09 at 21:02 -0700, Greg wrote: > Hello, > I'm trying to create a way for people to navigate through their search > results. Depending on how specific they are in their search they > could have 1 to 1,000 products get returned. I want to develop > something where my page will list 10 links at a time that when clicked > shows those 10 elements from my list. So there could be one number or > 100 depending on how many products were returned. > > I'm sending a template a variable that contains the length of a list. > I want to be able to create a link for each group of ten elements in > the list. So let's say that my length variable that is sent to the > template is 100. In my template I would need to have something like: > > {% for #notsure# %} > <a href="/mysite/?go={{ counter }}> {{ number }} </a> > {% endfor %} > > The output would be: > > 1 2 3 4 5 6 7 8 9 10 > > So if the user clicked on the '5' link my view would return > mylist[50:59]. > > //////////// > > Thanks for any help > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---