Newbie: Location of External method files
Please excuse my ignorance as I am new to Zope. Is the Extensions folder in the Zope root directory the only place that Python external method files can be located? Or, can external methods be placed in the Extensions folder of a Product (so that they are only visible within the scope of that Product). The reason why I ask this question is that if you have multiple developers storing external methods in the same folder (which can be accessed globally) how do you avoid methods with the same name? A related question I have is about how Zope looks for external methods. It seems that Zope looks along a certain path, in a way that is different from normal acquisition traversal. i.e. you cannot simply locate the external method in a parent folder and expect Zope to find it. If someone could explain how Zope searches for the external methods, I would appreciate this greatly. Thanks in advance, Vern Vern Takebayashi vern@hcc.hawaii.edu Honolulu Community College ICS/Engineering
On Wed, May 28, 2003 at 12:14:59PM -1000, Vern T Takebayashi wrote:
Please excuse my ignorance as I am new to Zope. Is the Extensions folder in the Zope root directory the only place that Python external method files can be located?
well, there's $SOFTWARE_HOME/Extensions and $INSTANCE_HOME/Extensions if you're using INSTANCE_HOME.
Or, can external methods be placed in the Extensions folder of a Product (so that they are only visible within the scope of that Product).
nope. If you want code that's only accessible to a Product, why are you using External Methods? Why not just define a method in the appropriate Product classes? Or a function, if that's more suitable?
A related question I have is about how Zope looks for external methods. It seems that Zope looks along a certain path, in a way that is different from normal acquisition traversal. i.e. you cannot simply locate the external method in a parent folder and expect Zope to find it.
Sure you can. I do it all the time. Do you have an example where this doesn't work? -- Paul Winkler http://www.slinkp.com
Paul Winkler wrote at 2003-5-28 14:27 -0400:
On Wed, May 28, 2003 at 12:14:59PM -1000, Vern T Takebayashi wrote:
Please excuse my ignorance as I am new to Zope. Is the Extensions folder in the Zope root directory the only place that Python external method files can be located?
well, there's $SOFTWARE_HOME/Extensions and $INSTANCE_HOME/Extensions if you're using INSTANCE_HOME.
Or, can external methods be placed in the Extensions folder of a Product (so that they are only visible within the scope of that Product).
nope.
I think, I know it better :-) When an External Method belongs to a product (e.g. External Methods that belong to CMFDefault or to support products), it is a *VERY* good idea (almost a must) to put the code for these External Methods in the "Extensions" subfolder of the product. When you create the External Method in Zope, you use "product_name.module_name" as module. Dieter
participants (3)
-
Dieter Maurer -
Paul Winkler -
Vern T Takebayashi