Yes. Always retrieve 11 records and display 10. Display the next
button only if the 11th record exists.

On Nov 8, 9:48 pm, mdmcginn <michael.d.mcgin...@gmail.com> wrote:
> My app retrieves 10 records at a time, and the user can click Next to
> view each page in order . That works until they reach the end of the
> records, where they get IndexError: list index out of range.
>
> To work around that problem, I wrote the following exception handling:
>
>  try:
>          redirect(URL(r=request,f='respond', args=p.id+1))
>  except IndexError:
>          redirect(URL(r=request,f='index'))
>
> Which doesn't seem to work - I still get the error. Is there a better
> solution?
>
> I haven't yet figured out how to write logic that says "When the user
> gets near the end, retrieve another 10 records so he doesn't run out."

Reply via email to