[Twisted-web] nevow tags and class attribute
Ellers
andrew at ellerton.net
Sat Apr 10 15:02:56 MDT 2004
On Sat, 10 Apr 2004 15:34:00 -0500, Matthew Scott <twisted at goldenspud.com> wrote:
> On Saturday 10 April 2004 14:53, Ellers wrote:
>> Using nevow.tags I want to emit a paragraph such as:
>> <p class="dirItem">blah</p>
>> Problem is, "class" is naturally a keyword so python won't let me do this:
>> return T.p("class"=paraClass)[ T.a(href=url)[resourceName] ]
>
>
> Use a leading underscore to assign something to "class". Nevow will strip
> that out for you:
>
>
> return T.p(_class=paraClass)[...]
>
Awesome - thanks!
More information about the Twisted-web
mailing list