Pipeline

pagemodel.pipeline

Pipeline helpers – simple callable chains for field value conversion.

The core class is Pipe, which wraps a sequence of callables and applies them in order when called. Pipes can be combined with the | operator.

Pipe

A chain of callables that are applied sequentially.

Pipe is used by field descriptors to implement the | syntax for inline converters.

Usage::

clean = Pipe(str.strip, str.lower)    # explicit Pipe
field = Q(".price") | float           # built via __or__
field = TextField(".price", converter=clean)
Methods:
__call__
__call__(value)

Apply the chain of callables to value and return the result.

A fast path is taken when the pipe contains a single function.

__or__
__or__(other)

Extend the pipeline with another callable (or Pipe).