[Twisted-Python] td() in form

Stephen Thorne stephen at thorne.id.au
Tue Oct 14 18:00:24 EDT 2003


Bob Ippolito wrote:

> On Tuesday, Oct 14, 2003, at 16:44 America/New_York, Itamar 
> Shtull-Trauring wrote:
>
>> On Tue, 14 Oct 2003 20:29:10 +0000
>> "vicky lupien" <lupien_v_31 at hotmail.com> wrote:
>>
>>> I' m suppose to write l.td(class='label').text(name) but I can't.  Is
>>> there a way to do this?
>>
>>
>> t = l.td()
>> t["class"] = "label"
>> t.text(name)
>
>
> There's no underscore hack for Python's reserved words in lmx?
>
> -bob

There is the underscore hack too
l = lmx()
l.td(_class='label').text(name)
will work as well.

You can prefix an _ to any kwarg, so you can also have td(_import=''), 
td(_if='blah'), etc.

Regards,
Stephen Thorne





More information about the Twisted-Python mailing list