[albatross-users] pagination question

Dan Bergan danb at champonline.com
Wed Apr 2 16:11:10 EST 2003


Andrew McNamara wrote:

>The only option I can think of is to keep multiple versions of the state
>and include a version number in each request. This gives you an effect
>like that of hidden field sessions, and is probably enough in 90% of
>applications, but doesn't fully solve the problem. It might be possible
>to give the application enough information to allow it to make sensible
>choices when the user backtracks (or forks their browser).
>
Ok, I made this a lot harder than I needed to!   When I process the 
request (getting the list of products for a category), I just needed to 
re-initialize my ListIterator to None and everything works fine.  So, in 
my template I have:
<al-for iter="rec" expr="items" pagesize="8" prepare/> (and so on...)
and in my page_process() method I check the request, and if I am 
processing a new category, then I set ctx.locals.rec = None and 
everything works perfectly.  I guess I didn't realize that the 
ListIterator "rec" would still be hanging around (but based on the 
behavior I was seeing, it makes perfect sense.)

I've done this to myself a couple of times now... Albatross is a great 
framework, now I just have to keep reminding myself that I don't have to 
make it a difficult framework!

Thanks,
Dan






More information about the Albatross-users mailing list