Text Input CSV Widget

Captured

None

Code (show in context)

    @view_config(renderer='templates/form.pt', name='textinputcsv')
    @demonstrate('Text Input CSV Widget')
    def textinputcsv(self):
        class Row(colander.TupleSchema):
            first = colander.SchemaNode(colander.Integer())
            second = colander.SchemaNode(colander.String())
            third = colander.SchemaNode(colander.Decimal())
        class Schema(colander.Schema):
            csv = Row()
        schema = Schema()
        form = deform.Form(schema, buttons=('submit',))
        # we don't need to assign a widget; the text input csv widget is the
        # default widget for tuples
        appstruct = {'csv':(1, 'hello', 4.5)}
        return self.render_form(form, appstruct=appstruct)