> So I am always getting an empty dictionary back to my action method. > > Sorry for the noise. In the meantime I've just gone back to creating an > interface with and @interface.invariant which is working for me. I was > just keen to find out if validator could be used. > I used validation directly in action function especially because I had some rdbms operations here. I've written a bit about this recently. Search for 'Formlib and custom validation constraints' thread. It is something like:
Function defined in my view class eg. descendant of EditForm from zope.app.form.interfaces import WidgetInputError def setWidgetError(self, name, v): """ Helper function for validation purposes. Sets error for widget @name - field name @v - error message """ w = self.widgets.get(name) if w: w._error = WidgetInputError( self.context.__name__, w.label, v) return w._error In function used as success handler I did: if not data['myfield']: error = self.setWidgetError('myfield', 'Required field is empty') self.errors.append(error) self.form_reset = False -- Maciej Wisniowski _______________________________________________ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users