On Thursday 09 June 2005 13:03, [EMAIL PROTECTED] wrote:
> Section 4.2 (page 12) has a Form constructor with this argument:
> attrs=None
> actually it's:
> **attrs
>
> The "attr" explanation needs to be revised. Suggestion: "attrs: are
> keyword arguments which are converted to additional HTML attributes in the
> <form> tag.
>
> The paragraph then highlights the 'class' attribute. But you can't have a
> keyword argument 'class'; that's a syntax error. That's a bug in
> Form.__init__: it assumes you can specify 'class' but you can't, and
> there's no other way to set the CSS class. (Of course you can set
> form.attrs['class'] later, but that's too advanced for a tutorial.)
>
Two more alternatives:
1. Form(**{'class':'classe'})
2. Form(css_class='classe')
both with the same result.
Seems like creators here wanted to say, 'do you know what you're doing?' :-)
Also, Html module merits a section although possibly it won't avoid having to
look at the code sometimes.
--Oscar
_______________________________________________
Quixote-users mailing list
[email protected]
http://mail.mems-exchange.org/mailman/listinfo/quixote-users