@view_config(renderer="templates/form.pt", name="mapping")
@demonstrate("Mapping Widget")
def mapping(self):
class Mapping(colander.Schema):
name = colander.SchemaNode(
colander.String(), description="Content name"
)
date = colander.SchemaNode(
colander.Date(),
widget=deform.widget.DatePartsWidget(),
description="Content date",
)
class Schema(colander.Schema):
number = colander.SchemaNode(colander.Integer())
mapping = Mapping()
schema = Schema()
form = deform.Form(schema, buttons=("submit",))
return self.render_form(form)