@view_config(renderer="templates/form.pt", name="fielddefaults")
@demonstrate("Field Defaults")
def fielddefaults(self):
class Schema(colander.Schema):
artist = colander.SchemaNode(
colander.String(), default="Grandaddy", description="Song name"
)
album = colander.SchemaNode(
colander.String(), default="Just Like the Fambly Cat"
)
song = colander.SchemaNode(
colander.String(), description="Song name"
)
schema = Schema()
form = deform.Form(schema, buttons=("submit",))
return self.render_form(form)