[Twisted-Python] Woven, using microdom.lmx, and trying to use style sheets

Matthew Scott twisted at goldenspud.com
Wed Oct 29 13:29:20 EST 2003

On Wednesday 29 October 2003 11:59 am, Donovan Preston wrote:
> On Oct 29, 2003, at 12:44 PM, Hegedus, Matthew S wrote:
> > I tried t.tr['class'] = "mySpecialTableRowStyleClass" but then I got
> > bitched
> > at with an "object does not support item assignment". Thanks,
> t.tr(_class="mySpecialTableRowStyleClass")
> Since class is a python keyword, the special case of having a leading
> underscore is used.

I ran into this recently too :)

Just an extra note, the leading underscore is not required when setting the 
class attribute of an existing node:

node = t.tr()
node['class'] = 'mySpecialTableRowStyleClass'

Matthew Scott

More information about the Twisted-Python mailing list