[Twisted-Python] LivePage Hello World

Donovan Preston dp at twistedmatrix.com
Thu May 22 01:44:37 EDT 2003


On Wednesday, May 21, 2003, at 09:29 PM, Eric Holm wrote:

> That did it, now I'm one dangerous guinea pig!  At
> this rate, I won't have to write a wxPython/pb
> front-end to my server.

Just to give you some more hints, the methods you want to look at to 
make your Woven apps magically delicious are:

Widget.addEventHandler('onclick', self.onClick)
# Add a javascript event handler to this widget which, when the event 
occurs
# in the browser, causes the server side method to be called

Model.notify({'request': request})
# Tell all widgets that rely on this model to re-render themselves with 
the
# latest model data and send the resulting HTML string to the browser,
# which will then replace the old HTML with the new, updated HTML.

Widget.modelChanged({'request': request})
# This is what gets called by Model.notify and actually does the
# rerendering. It then passes the HTML string to the controller, which
# sends it out over the OutputConduit.

# You can call this directly if you really want to, but I encourage you
# to try to use MVC notification

Those three are pretty much all you need to create full on DHTML 
applications using pure, server-side Python.

Donovan





More information about the Twisted-Python mailing list