[albatross-users] more data tricks for the wiki

Dave Cole djc at object-craft.com.au
Fri Jul 4 10:42:40 EST 2003


>>>>> "Eric" == Eric S Johansson <esj at harvee.org> writes:

Eric> what's interesting is the difference in terms of what is
Eric> returned.  An albatross, it's an iterator object; in Python
Eric> iterators (as demonstrated by examples in the article referenced
Eric> above) it's an ordinary piece of data (integer, float, string
Eric> etc.).

One of the limitations that Albatross has to live with is that real
iterators and generators cannot be pickled.  This means that they
cannot be saved in a session.  If you use pagination in your <al-for>
tag the ListIterator is placed in the session so it can "remember"
where you were in the sequence.

Thinking out loud:

Currently pagination is handled by saving a ListIterator in the
session.  The browser request then issues a nextpage or prevpage
request and names the iterator.

    <al-a href="nextpage,i">next</al-a whitespace>
    <al-input type="submit" nextpage="i" whitespace>

results in

    <a href="http://server/app.py/nextpage,i">next</a>
    <input type="submit" name="nextpage,i">

Maybe a better way to do this would be to place all of the information
required for pagination into the browser request.  This would result
in output that looked something like this

    <a href="http://server/app.py/goto,i,20">next</a>
    <input type="submit" name="goto,i,20">

The nice outcome of this would be that we do not need to save anything
in the session anymore.  It would also allow you to bookmark specific
pages in an application.

- Dave

-- 
http://www.object-craft.com.au




More information about the Albatross-users mailing list