The iterator named in the iter (5.3.7.5) attribute of the <al-for> tag is an instance of this class. By using an object to iterate over the sequence the toolkit is able to provide additional data that is useful in formatting HTML.
The iterator will retrieve each value from the sequence exactly once. This allows you to use objects that act as sequences by implementing the Python sequence protocol. Only __getitem__() is required unless you use pagination, then __len__() is also required.
) |
) |
TRUE
if the page start index is greater than
zero indicating that there is a previous page.
) |
TRUE
if the sequence length is greater than the page
start index plus the _pagesize member indicating
that there is a next page.
If the iterator has not been placed into ``page mode'' by the presence of a pagesize attribute a ListIteratorError exception will be raised.
) |
) |
) |
index() - start()
.
) |
Most of the methods and all of the members are not meant to be accessed from your code but are documented below to help clarify how the iterator behaves.
None
and set by
set_sequence().
None
indicates that the state is unknown and will be
established when the sequence is next accessed, zero indicates that
the end of sequence has been reached and there is no valid element,
and one indicates the current element is valid.
0
and set by the presence
of a pagesize attribute in the <al-for> tag.
) |
tup) |
) |
op, value) |
The value argument is the browser submitted value for the
backdoor field. If a value was submitted for the backdoor field then
the op argument is processed. If op equals
"prevpage"
or "nextpage"
then the iterator selects
the previous or next page respectively.
op) |
1
.
size) |
) |
None
).
seq) |
) |
) |
) |
None
which causes the
next call of has_value() to retrieve the sequence element
indexed by _index.
) |
None
this method tries
to retrieve the sequence element indexed by _index. If an
element is returned by the sequence it is saved in the _value
member and _have_value is set to one. If an
IndexError exception is raised by the sequence then
_have_value is set to zero.
The method returns TRUE if a sequence member is contained in _value.
By this mechanism the iterator retrieves each value from the sequence exactly once.
) |
value) |