From: Ben B. <be...@gr...> - 2005-05-18 20:43:04
|
On 5/18/05 1:32 PM, "Ian Bicking" <ia...@co...> wrote: > Ben Bangert wrote: >> I currently check for errors on the form like this: >> form = htmlform.HTMLForm(html,formschemas.BillShipPage()) >> errors = {} >> form_result, errors = form.validate(self.ARGS) >> >> I then pass the errors that returns into the htmlfill. Html in the above is >> a form snippet. What is the recommended way to obtain the errors dict passed >> into htmlfill? > > I was returning the wrong thing in htmlform -- should be fixed in svn now. I just ran svn up and saw the htmlform update, however it doesn't seem to have changed it. Should I be using something other than form.validate to pull that flat dict of error strings out? In the meantime this did get my form running: newerrors = {} for key, val in errors.iteritems(): newerrors[key] = val.unpack_errors() parser = htmlfill.FillingParser(defaults = self.ARGS, errors = newerrors) - Ben |