On Apr 8, 2006, at 7:29 PM, Michele Cella wrote:

>
> Hi Max,
>
> thanks for the feedback.
>
> I'm also convinced that the former solution is much easier, the  
> problem
> is that I don't really want TG widgets to get into your way of doing
> things, the TG philosophy (as I've got it at least) is to not hide  
> some
> of the components we use, in this case FormEncode, and from some
> blog/feedback I've read this gives a nice feeling.
>
> In other words I wouldn't want widgets to to magic things on the
> validation side, like the is_required parameter that acts on the
> not_empty attribute.
>
> I mean this is easier:
>
> TextField(is_required=True)
>
> but this is more explicit of what's going on, doesn't hide FE and
> follows the Widget philosophy or reusing FE and it's feature (not only
> a simple validator but also a Schema).
>
> TextField(validator=NotEmpty())

Agree

>
> the solution I'm proposing is needed for such widget that already
> provide a default validator (SelectionField, FileField in the future)
> and when you would like to tweak some parameters without redefining  
> the
> entire validator:
>
> MultipleSelectionField(validators_args={'not_empty':True})

mmm, I don't think I like this "validator_args" new param. Couldn't  
the same outcome be achieved by:
MultipleSelectionField(validator=V(not_empty=True)) I think it's more  
explicit to redefine the whole validator if you need to tweak something.

I undersand that normally these widget's try to provide a reasonable  
default validator, but I think that if you already know that a field  
is required, you also know what validator to override it with.

This is a just an impression though, I'm probably missing something  
important as i'm a bit "off" the widgets lately.

Nice work! :)


Alberto

--~--~---------~--~----~------------~-------~--~----~
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