On 2/7/06, Alberto <[EMAIL PROTECTED]> wrote:
>
> Kevin Dangoor wrote:
> > That way, widget users can always do this:
> >
> > TableForm(widgets = [TextAreaField("foo")])
>
> Just a matter of style... I personally favour named arguments, though
> more verbose, for something like this, where we have multiple levels of
> inheritance and parameters accepted at various layers.To be clear: this is strictly for the "name" parameter. It's used on every form input field, which is why I think it deserves somewhat special treatment. > I also think we should apply Michele's suggestion (#490, try finding > "CalendarDatePicker" at the page if you don't want to get booored... ;) > of listing at the constructor of our Widget subclasses all the > parameters of our superclass (plus the new ones we are taking) to avoid > **kw abuse (and possible bugs). Though if were subclassing more than > one superclass this might not apply... (as most of the widgets at > forms.py which subclass FormWidget and SimpleWidget). Ideally, there wouldn't be **kw at all... but, realistically, the subclasses need it, otherwise they can't take advantage of new base class features easily. Widget no longer has **kw, so at least you'll get an error if you pass in something invalid and it makes it all the way up. Kevin

