Adding to this week's record traffic on quixote-users, this issue
began as a thread on our internal mailing list.
I found a bit of our code that didn't call a submit button's render()
method; instead it did ' tag should get the attributes, and the tags will
be left alone. (If you want to add attributes to the option tags,
you'll have to subclass the widget and override the render() method.)
But what about, say, ListWidget, which renders an arbitrary list of
widgets? Should the attributes be passed to all of the contained
widgets or not? Some attributes, such as 'class' might make sense
applied to all the subwidgets but for others, such as Javascript
'onClick' attributes, this doesn't make sense.
My current proposal is to support the 'attributes' parameter on all
render() methods, but it'll only be used on "simple" widgets where
it's clear to apply it. The composite widgets in quixote.form.widgets
won't use it, and in fact I think they should raise an exception if
attributes isn't empty. User-written subclasses can do whatever they
like, of course.
Thoughts? (Neil, you had some reservations about the earlier
suggestion. Does this idea avoid them?)
--amk