after a longer debugging session I found out that you can't use a FieldSet
which only contains CheckBoxes (see attached example). If none of the boxes is
checked, the validation generation an error because the 'fieldset' is empty.
I think the reason is in tw.forms.core (generate_schema). A new schema is
generated but thanks to FormEncode's defaults (Schema is a standard
FancyValidator and implements a bad empty-ness check) it'll not recurse to
it's children when encountering an 'empty' value.
I'm not entirely sure what the best fix is here (I got so frustrated with
formencode's weirdness that I wrote my own validation long ago) but I think
the problem should be obvious.
fs
fs
--
You received this message because you are subscribed to the Google Groups "ToscaWidgets-discuss" group.
To post to this group, send email to toscawidge...@googlegroups.com.
To unsubscribe from this group, send email to toscawidgets-dis...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/toscawidgets-discuss?hl=en.
Am 09.02.2012 11:03, schrieb Paul Johnston:
> There probably is a kludge to make this work, but really it's this kind of
> confusion that caused me to move away from FormEncode with tw2.
What do you use instead of FormEncode?
(I found so many strange cases in FormEncode two years ago that I wrote my own
validation library [1])
> Suggest you look at moving your app to tw2.
Let's see. MediaCore (www.mediacorecommunity.org) is a pretty big project and
changing all the forms is a pretty big project which doesn't add too much user
value.
Also I have to say that I found ToscaWidgets (1) very hard to debug because of
the (excessive) inheritance chains which often only add an attribute or so.
Also the lack of documentation was a pretty big blocker for me (how do I
customize it, write custom form templates etc). Just skimming over the tw2
docs, looks like there are some improvements in this area.
cheers
Felix
What do you use instead of FormEncode?
(I found so many strange cases in FormEncode two years ago that I wrote my own
validation library [1])
Let's see. MediaCore (www.mediacorecommunity.org) is a pretty big project and
changing all the forms is a pretty big project which doesn't add too much user
value.