--On 5. Dezember 2007 19:35:22 -0500 Ken Winter <[EMAIL PROTECTED]> wrote:

I'm customizing a product.  To do what I'm trying to do, I need to be able
to access REQUEST data from within a Python module (not a script; a .py
file containing class and method definitions).

From within a script, a line like

        req = context.REQUEST

does the job just fine.  But when I put that line into my product module,
I get a message like:

        Name "context" not defined

and I don't see any way to import that into my module.

Either you have to pass down the request object down to your own code or you pass the current 'context' object down to your code and access the request object from their using context.REQUEST. Don't expect that the current REQUEST is magically available. So the solution for questions 1-3 is: pass down the parameters that you need from the location where you have them and from where you call your own code (which is likely a script or a template).


Attachment: pgpQrHUYfam6N.pgp
Description: PGP signature

Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to