- Document deferred.

This commit is contained in:
Chris McDonough
2010-09-08 20:46:04 +00:00
parent 514b06a58c
commit 02160a7dc2
2 changed files with 8 additions and 0 deletions

View File

@@ -118,6 +118,8 @@ Schema-Related
.. autoclass:: SequenceSchema
.. autoclass:: deferred
.. attribute:: null
Represents a null value in colander-related operations.

View File

@@ -154,6 +154,12 @@ Let's take a look at an example:
default_date = datetime.date.today(),
categories = [('one', 'One'), ('two', 'Two')]
)
We use ``colander.deferred`` in its preferred manner here: as a
decorator to a function that takes two arguments. For a schema node
value to be considered deferred, it must be an instance of
``colander.deferred`` and using that class as a decorator is the
easiest way to ensure that this happens.
To perform binding, the ``bind`` method of a schema node must be
called. ``bind`` returns a *clone* of the schema node (and its