Interfaces

Interface that describes the TALES implementation.

interface zope.tales.interfaces.ITALESFunctionNamespace[source]

Function namespaces can be used in TALES path expressions to extract information in non-default ways.

setEngine(engine)

Sets the engine that is used to evaluate TALES expressions.

interface zope.tales.interfaces.ITALESExpression[source]

TALES expression

These are expression handlers that handle a specific type of expression in TALES, e.g. path or string expression.

__call__(econtext)

Evaluate expression according to the given execution context econtext and return computed value.

interface zope.tales.interfaces.ITALESIterator[source]

Extends: zope.tal.interfaces.ITALIterator

TAL Iterator provided by TALES.

Values of this iterator are assigned to items in the repeat namespace.

For example, with a TAL statement like: tal:repeat="item items", an iterator will be assigned to repeat/item (using a path expression). The iterator provides a number of handy methods useful in writing TAL loops.

The results are undefined of calling any of the methods except length before the first iteration.

index()

Return the position (starting with “0”) within the iteration

number()

Return the position (starting with “1”) within the iteration

even()

Return whether the current position is even.

odd()

Return whether the current position is odd

parity()

Return ‘odd’ or ‘even’ depending on the position’s parity

Useful for assigning CSS class names to table rows.

start()

Return whether the current position is the first position

end()

Return whether the current position is the last position

letter()

Return the position (starting with “a”) within the iteration

Letter()

Return the position (starting with “A”) within the iteration

roman()

Return the position (starting with “i”) within the iteration

Roman()

Return the position (starting with “I”) within the iteration

item()

Return the item at the current position

length()

Return the length of the sequence

Note that this may fail if the TAL iterator was created on a Python iterator.