[Twisted-Python] woven authentications and connections.

Syver Enstad syver at inout.no
Tue Oct 7 02:23:45 MDT 2003


Donovan Preston <dp at twistedmatrix.com> writes:

> On Oct 6, 2003, at 4:17 AM, Syver Enstad wrote:
> 
> > Donovan Preston <dp at twistedmatrix.com> writes:
> >
> >> On Oct 3, 2003, at 4:47 AM, Syver Enstad wrote:
> >>
> >>>
> >>> I am in the process of implementing authentication for an intranet
> >>> application using woven. I will be storing the login information in
> >>> the session. On each request I will connect to the database and pass
> >>> the connection to the page handling the request. How do I know when
> >>> the request is finished so that I can close the connection?
> >>
> >> Overriding Page.pageRenderComplete should be what you want.
> >
> > Thanks, I found another way by calling request.notifyFinished which
> > returns a deferred, I then add a callback to that deferred and it
> > seems to work fine. *The following is not a rethorical question, I am
> > just curious.* In what way is overriding Controller.pageRenderComplete
> > superior to my solution?
> 
> It's not. Your solution is superior. :-) Thanks for pointing it out.

Ok, so even better would be for the page to add pageRenderComplete
callback by calling request.notifyFinished? And then overriding
pageRenderComplete is the superior solution again?





More information about the Twisted-Python mailing list