Python + Win32ALL + ASP = Problems accessing Request/Response/Session/Application objects

Max M maxm at mxm.dk
Wed Jul 24 04:56:45 EDT 2002


Joe Salmeri wrote:

> How are the ASP Request/Response/Session/Application objects accessed in a
> module that is imported in an ASP file WITHOUT passing them in as paramaters
> to each of the functions defined in that module?  I have attempted to track
> down the creation of those objects but have been unable to trace them to the
> source of their creation.


You would probably be better of in the long run if you used a facade to 
cover your code in.

You would then only output finished html from the facade object.

<%

class PageFacade:

     def __init__(self, message='blah blah'):
         self.message = message

     def blah(self):
         return self.message

     def update(self, req):
         self.message = req.Form('message')
         # 'insert message into theTable '

f = PageFacade()
save = Request.Form('save')
if save:
     f.update(Request)

%>

<html>
here is some code that reads <%= f.blah()%>
</html>

This has a lot of advantages. Especially if you are writing database 
driven websites.

regards Max M




More information about the Python-list mailing list