I am using deform and I am having some trouble extracting information
from a validate() form operation on sequence type forms.  I get an
empty structure returned.  I have created the below example from the
online examples to illustrate my issue:

import deform
import colander

choices = (
        ('habanero', 'habanero'),
        ('jalapeno', 'jalapeno'),
        ('chipotle', 'chipotle')
)
class Peppers(colander.SequenceSchema):
  pepper = colander.SchemaNode(
      colander.String(),
      validator=colander.OneOf([x[0] for x in choices]),
      widget=deform.widget.RadioChoiceWidget(values=choices),
      title='Pepper Chooser',
      description='Select a Pepper')
class Schema(colander.Schema):
  peppers = Peppers()

controls=[
        (u'__formid__', u'deform'),
        (u'_charset_', u'UTF-8'),
        (u'__start__', u'pepper:rename'),
        (u'deformField3-xuQt6U', u'jalapeno'),
        (u'__end__', u'peppers:sequence'),
        (u'submit', u'submit'),
]

schema = Schema()
form = deform.Form(schema, buttons=('submit',))
appstruct = form.validate(controls)
print appstruct

python test_deform.py
{'peppers': []}

The controls structure I am passing it in the example I intercepted
from a submit.  I am getting no validation errors.  The documentation
says the controls structure should be "document-ordered".  I think
that may be what is causing it, but I am not sure.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to