Thank you for that makes perfect sense. This might be a stupid question but do I need to create an individual HTML page for each result set? The whole pagination thing is a mystery to me!
On Monday, 23 July 2012 21:33:34 UTC+1, Niphlod wrote: > > That's math! > e.g. > records_per_page = 10 records > all_records = 137 records > > pages_needed = all_records / records_per_page (division) > last_page = all_records % records_per_page (module) > > that is 13 "full pages" + 1 page with 7 records. > > So, you'll have to count the total of your records, divide it by the > number of "records per page" , an voila. > > If you want urls in the form of (/myapp/mycontroller/myfunction/1, > /myapp/mycontroller/myfunction/2, /myapp/mycontroller/myfunction/3, etc) it > would roughly translate to: > > all_records = 137 > records_per_page = 10 > urls = [URL('myapp', 'mycontroller', 'myfunction', args=[page+1]) forpage > in range(all_records+1)] > > > > On Monday, July 23, 2012 10:20:48 PM UTC+2, adohertyd wrote: >> >> I have an application that returns a list of between 50-100 items. I have >> no database layer it isn't required for my app. I want to display 10 of >> those items on a page, and only generate the number of pages needed to view >> those results. Can anyone point me in the right direction (not the docs, >> they don't make any sense to me for this problem). Thank you > > --