I'm not sure I fully understand what Python Script's container and context refer to. Can someone help me out? As near as I can tell: container=self or the folder one is contained in context=the under namespace (_), including REQUEST and the namespaces of all parent folders? -- Ed Goppelt
context = self from python container is the object that contains the python script On Fri, 16 Mar 2001, Edmund Goppelt wrote:
I'm not sure I fully understand what Python Script's container and context refer to. Can someone help me out? As near as I can tell:
container=self or the folder one is contained in context=the under namespace (_), including REQUEST and the namespaces of all parent folders?
From: "Edmund Goppelt" <goppelt@goppelt.net>
I'm not sure I fully understand what Python Script's container and context refer to.
Make two folders in your Zope root, called "F1" and "F2". Put a Script in "F1", call it "S". Now, S will always have container==F1, but its context depends on the path you take to get to it. Thanks to acquisition, you can follow a path like "/F1/F2/S", which will give you S with context==F2. Both context and container can be used to get at REQUEST, since you can acquire REQUEST from any Zope object. The namespace "_", on the other hand, is a special feature of DTML. The only way you'll have to deal with the namespace stack in a Script is if you deliberately pass it in as a parameter, or you take a Script that has been set up with a namespace binding, and call it like this: <dtml-var name="S">. Cheers, Evan @ digicool
Close... container is the folder the PythonScript is contained in, BUT it is also your connection to REQUEST and RESPONSE aka. container.REQUEST is the REQUEST and container.REQUEST.RESPONSE is RESPONSE Jason Straw jstraw@towhee.com www.zope.org/Members/jtsswim/assignments/ the assignment zite On 16 Mar 2001 18:07:14 -0500, Edmund Goppelt wrote:
I'm not sure I fully understand what Python Script's container and context refer to. Can someone help me out? As near as I can tell:
container=self or the folder one is contained in context=the under namespace (_), including REQUEST and the namespaces of all parent folders?
--
Ed Goppelt
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (4)
-
Edmund Goppelt -
Evan Simpson -
Jason Straw -
kosh