Hi, I’m having trouble adding an External Method in the ZMI that will call the Install.py file I’ve written to install a new Archetype. I’ve followed the code in this article: HYPERLINK "http://www.zopemag.com/Issue006/Section_Articles/article_IntroToArchteypes. html"http://www.zopemag.com/Issue006/Section_Articles/article_IntroToArchtey pes.html When I get to the point of adding this external method: id: install_article module: MyArticle.Install function: install I get this error: “The specified module, MyArticle.Install, couldn't be found.” Being new to Zope I’m probably missing something obvious! Anyone have any ideas? Thanks Rich --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003
richard wrote:
I’ve followed the code in this article:
http://www.zopemag.com/Issue006/Section_Articles/article_IntroToArchteypes.h...
When I get to the point of adding this external method:
id: install_article module: MyArticle.Install function: install
I get this error: “The specified module, //MyArticle.Install//, couldn't be found.”
The article you referenced is discussing the creation of a Zope Product, which are Python packages and reside under ${ZOPE_HOME}/Products/. You are trying to create an External Method, which is a function inside a Python module, and resides in ${ZOPE_HOME}/Extensions. AFAIK, External Methods can only be modules, not a module ("install.py") inside a subdirectory ("MyArticle") as you are attempting. You might have more luck working inside the Products directory, but starting out so early with Zope Products is ... daring. It will be difficult. HTH, JZ
John Ziniti wrote at 2004-5-4 15:45 -0400:
... The article you referenced is discussing the creation of a Zope Product, which are Python packages and reside under ${ZOPE_HOME}/Products/. You are trying to create an External Method, which is a function inside a Python module, and resides in ${ZOPE_HOME}/Extensions. AFAIK, External Methods can only be modules, not a module ("install.py") inside a subdirectory ("MyArticle") as you are attempting.
A side note: External Methods can (and should) be associated with products. Such External Methods live in "Products/<the product>/Extensions", the "module" spec has the from "<the product>.<the file>". -- Dieter
Dieter Maurer wrote:
John Ziniti wrote at 2004-5-4 15:45 -0400:
... The article you referenced is discussing the creation of a Zope Product, which are Python packages and reside under ${ZOPE_HOME}/Products/. You are trying to create an External Method, which is a function inside a Python module, and resides in ${ZOPE_HOME}/Extensions. AFAIK, External Methods can only be modules, not a module ("install.py") inside a subdirectory ("MyArticle") as you are attempting.
A side note:
External Methods can (and should) be associated with products.
Such External Methods live in "Products/<the product>/Extensions", the "module" spec has the from "<the product>.<the file>".
Interesting. I was unaware of that ability. In which case, the OP should make sure that his MyArticle Product is in the correct ${ZOPE_HOME}/Products, that Zope has been restarted to load the Product and that the Control_Panel shows that the Product has been loaded correctly. Dieter, can you elaborate a bit on "should be associated"? Are there additional benefits to doing it this way, as opposed to sticking the script in the "primary" Extensions folder? Thanks for the help, as always. JZ
John Ziniti wrote at 2004-5-6 12:50 -0400:
...
External Methods can (and should) be associated with products. ... Dieter, can you elaborate a bit on "should be associated"? Are there additional benefits to doing it this way, as opposed to sticking the script in the "primary" Extensions folder?
When the external method can be associated with a product (such as e.g. the methods for installation), then they should be maintained in the products context. When you do not use this opportunity, the "primary Extensions folder" will clutter much more than necessary. Name conflicts may arise, locality suffers. -- Dieter
Dieter Maurer wrote:
John Ziniti wrote at 2004-5-4 15:45 -0400:
... The article you referenced is discussing the creation of a Zope Product, which are Python packages and reside under ${ZOPE_HOME}/Products/. You are trying to create an External Method, which is a function inside a Python module, and resides in ${ZOPE_HOME}/Extensions. AFAIK, External Methods can only be modules, not a module ("install.py") inside a subdirectory ("MyArticle") as you are attempting.
A side note:
External Methods can (and should) be associated with products.
Such External Methods live in "Products/<the product>/Extensions", the "module" spec has the from "<the product>.<the file>".
Interesting. I was unaware of that ability. In which case, the OP should make sure that his MyArticle Product is in the correct ${ZOPE_HOME}/Products, that Zope has been restarted to load the Product and that the Control_Panel shows that the Product has been loaded correctly. Dieter, can you elaborate a bit on "should be associated"? Are there additional benefits to doing it this way, as opposed to sticking the script in the "primary" Extensions folder? Thanks for the help, as always. JZ
participants (3)
-
Dieter Maurer -
John Ziniti -
richard