Alberto Valverde wrote: > > mmm, looks like a good idea.. I'll try and update patch, however, > can_add_field is needed because it's there to make sure that if you > set a custom schema in a FieldsContainer it's fields prevail over the > widget's own... gee, better code it: > > class MySchema(Schema): > age = Int() > > class Fields(WD): > age = TextField(validator=String()) > > form = Form(fields=Fields(), validator=MySchema()) > > Then "age" will be validated by Int(), not String() I think that this > is important because it let's you reuse schemas more consistently > (don't worrying about the validators on the widgets you're validating) >
Ok, seems a good behavior... > Now slightly off-topic, shouldn't the template_var "attrs" belong to > FormField instead of repeating it at almost every FormField? > No, the almost is important, we don't support it for every FormField since attrs makes sense only on simple fields (that's why we had SimpleWidget before), not in a RadioButtonList or CheckBoxList we are the attrs specified going to end up? <ul>? <li>? <input>? unpredictable IMHO. ;-) 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 -~----------~----~----~----~------~----~------~--~---
