Yep, we don't need a validator for strings, but the point is that we  
need some way to tell generate_schema to know which fields expect  
input. This is so we can make stricter checks at the Schema (like  
filter_extra_fields=True and allow_extra_fields=False) by default and  
make sure no spurious variables reach the controller.

This is not needed when there are no nested widgets as the method's  
signature won't match (unless they have **kw), but it's needed for  
extra safety at nested widgets IMO. I explain  better in another post  
at this thread how a spurious var could slip in...

The problem is that all fields that expect input should have a  
validator, even a do nothing validator (for strings) so the schema  
knows when an extra variable is being sent. I don't see as a problem  
really as it makes more explicit which widget's are for input and  
which aren't and enforces the good practice of validating every  
single variable that get's in to an app.

don't know if I'm expressing myself so I'll gladly re-explain (with  
POC if needed) :)

Regards,
Alberto


On 10/03/2006, at 22:27, Kevin Dangoor wrote:

>
> On 3/10/06, Alberto Valverde <[EMAIL PROTECTED]> wrote:
>>>> What I'd really like to fix when this get's in (I have a sort of
>>>> cumbersome poor-man's svn with this patch numbering stuff :) Is the
>>>> allow_extra_fields = True (setting it to false) and possibly  
>>>> adding a
>>>> filter_extra_fields=True too. Needs some more testing though as  
>>>> some
>>>> tests where failing when I tried it (probably because some input-
>>>> expecting widget's didn't have a validator) but didn't look into it
>>>> too closely... There's a post in this thread where I explain better
>>>> the reasoning behind this...
>>>>
>>>
>>> We may ask Kevin what's opinion, should we expect a validator for
>>> every
>>> field?
>>
>> For every field that might generate input: yes IMO.  It just sounds
>> "good parctice" to me... Kevin, where are you? :)
>
> For fields that are fine just taking a string, we don't really need a
> validator... but, if we want one that just passes the string through,
> that's fine.
>
> Kevin
>
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk
-~----------~----~----~----~------~----~------~--~---

Reply via email to