I'm curious about custom validators on a form action:

@action('Edit', validator=my_validator)
def edit(self, **data):

The validator is called from 'update' method of the form:
formlib/form.py line 736:

  errors, action = handleSubmit(self.actions, data, self.validate)

but the line previous says

  data = {}

So my validator always receives an empty dictionary to validate.

The validator is called with arguments 'form, action, data' and should
return a list of errors (if any). Do I need then to use the form object
to retrieve the submitted values? If so, why is 'data' passed at all if
it is always an empty dictionary?


PS I know and have used @invariant but I'm generating the schema
formfields instead of using an interface (where I would normally place
the invariant).

Zope3-users mailing list

Reply via email to