[Twisted-web] Instance of child element class never goes away?

Jay jay at meangrape.com
Tue Nov 8 20:36:15 MST 2005


Hi, all.

This is my first swing at using twisted...and I'm not much of a python
jockey either.  I'm using twisted.web2, python 2.4.2 on FreeBSD.

I've got a simple (two page) application right now -- most of it is
shamelessly cribbed from the example provided in the documentation.

There's the TopLevel which has one child page -- child_antitrypsin.
child_antitrypsin is an instance of a Query class that returns a plain old
HTML string via http.Response.

Now, to get that string, the Query class has to send a request to another
server, get and parse an XML document and construct the string.  All well
and good.

The problem I'm having is that the first child_antitrypsin that gets
instantiated seems to be the only one that ever gets created.  Refreshing
the page -- or clicking on the link -- gives me the string twice...or three
times or however many.  So, if the first result was "APPLE", the second
time, I'd get "APPLEAPPLE" and so on.

lynx -dump -head shows that the Last-Modified time is always the same (ie,
the creation time).

The behavior I expected was for the link to get clicked, the child to get
instantiated, do its work, return a result and go away.  Do I need to
explicitly kill the child object?  

Thanks!

-- 
Jay.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20051108/00607efe/attachment.pgp


More information about the Twisted-web mailing list