Michele Cella wrote:
>
> Ok, you're right... I will take a look a this later today. ;-)
>
Ok, plan for action:
- Add a is_required parameter at __init__, defaults to False
- Make the actual is_required property a private function only used by
update_data of FormField
- is_required will reflect the __init__ is_required parameter value
- in meta.py while building the form Schema:
if is_required = False:
wrap the validator in this way Any(Empty(), validator)
else:
wrap the validator in this way All(NotEmpty(), validator)
we need to use Any and All since ATM not_empty doesn't work right for
many validator (Int() comes to mind).
Opinions? Alberto (generate_schema guru :P)?
I think this should work, should we wrap the validator with Any and All
in the final schema or do it inside every form field (decorating the
init method) and then use that in the Schema?
Ciao
Michele
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---