[Twisted-web] Adding Athena JS handlers in render methods?

Jean-Paul Calderone exarkun at divmod.com
Mon Jul 30 10:25:43 EDT 2007

On Tue, 24 Jul 2007 13:42:36 +0300, kgi <iacovou at gmail.com> wrote:
>Hi all.
>I hit something earlier today that has me stumped. It might be a case of
>programming blindness, but on the other hand I might just be trying to do
>something that isn't supported.
>Up until now, I've been adding Athena event handlers directly in the
>docFactory's stan. However, I needed to add something with an Athena event
>handler that needs data from an asynchronous external source, so I added data
>and render methods.
> [snip - event handlers in stan returned by render/data methods don't work]
>Am I trying to do something unsupported, or is this a bug?

It's unsupported.  What you can do instead is to put the event handlers into
the template (stan or xhtml) as patterns.  This will result in them being
rewritten properly.  Your render and data methods will thus be able to load
them, already pre-processed, from the docFactory and put them in the page.


More information about the Twisted-web mailing list