Pylons/colander — pull request #62 by stefanofontanelli (2012-08-14 07:32:59+00:00)
Title: Feature: 'default' and missing 'missing' of SchemaNode can be callables.

This commit allows the following code:

import colander
import datetime

class Log(colander.MappingSchema):
service_name = colander.SchemaNode(colander.String())
action = colander.SchemaNode(colander.String())
timestamp = colander.SchemaNode(colander.DateTime(),
default=datetime.datetime.now,
missing=datetime.datetime.now)

Log.default and Log.missing are not statically assigned, instead they will be "generated" at serialization/deserialization time.