Python + Win32ALL + ASP = Problems accessing Request/Response/Session/Application objects
Joe Salmeri
JoeSalmeri at comcast.net
Wed Jul 24 19:40:55 EDT 2002
Hopefully Mark Hammond will see this, I'm sure he will be able to provide
the answer (he always does!)
"Max M" <maxm at mxm.dk> wrote in message news:3D3E6BCD.4010809 at mxm.dk...
> 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