Re: Patch for labelfield "validation"

Reinout van Rees <[email protected]> Fri, 22 Apr 2005 23:49:57 +0200 (CEST)
Newsgroups gmane.comp.web.zope.formulator.devel
Message-ID <Pine.OSX.4.58.0504222337410.29118@reinout-van-rees-computer.local>
On Fri, 22 Apr 2005, Clemens Klein-Robbenhaar wrote:

> Added to the CVS. I felt so free to add a "enable=0" to the new
> "external_validator" field, so it does not show up in the ZMI of the
> LabelField. The drawback is that now the patch only works on new
> LabelFields, not already existing ones.

Fine with me. I *think* it's a thing not many people were having
problems with. Thanks for adding it, btw.

I spend the day improving ploneformmailer (which wednesday tripped the
now-fixed bug) and got the idea that there's something that's not done
properly.

a) What I'd expect: ploneformmailer calls
form.validate_entire_form_or_so and afterwards iterates over the
fields and gets a value out of them.

b) What ploneformmailer does: it doesn't call the entire-form
validator, but iterates over the fields and uses field.validate() to
get the value out of the field...

I added the call to validate the entire form in one go (also doing
away with the validation of label fields): no problem. But I couldn't
really find a good function to call to get the value out of a field.
Just a list of selected options for a multicheckboxfield, for
instance. field.validate() seemed like the best option after all.

I'm guessing there's a better way. Any pointers?

Greetings,
Reinout

p.s.: I added a few small improvements to ploneformmailer today.
Improving the looks of the generated (html) email and improving the
visualisatio of multicheckboxes and labels. Just in case somebody here
uses it with formulator.

-- 
Reinout van Rees                  r.van.rees-1kr/[email protected]
http://vanrees.org/weblog/            http://zestsoftware.nl
"engineer: a mechanism for converting caffeine into designs"