On Apr 3, 2008, at 8:22 AM, Markus Bleicher wrote:
John DeStefano wrote:
On Apr 2, 2008, at 8:49 AM, Markus Bleicher wrote:
deesto wrote:
In an "old-style" product imported into Buildout, where is the proper place
for the 'PROJECTNAME = ' declaration? I assumed it would be here:
src/my.project/Products/MyProject/config.py
But this does not work:
NameError: name 'PROJECTNAME' is not defined

The config.py-file is the standard place to define PROJECTNAME.
But - as someone has already mentioned - you need to import it, i.e.
you need a line

from Products.MyProject.config import PROJECTNAME

in the file where python complains.

Thanks Markus. No complaints now on instance start-up, and the product installs successfully in Plone as well. However, after installing, browsing to a location in which the product could be used in the site generates an error in Zope: 2008-04-02 10:04:45 ERROR CMFCore.TypesTool _queryFactoryMethod raised an exception
Traceback (most recent call last):
File "parts/plone/CMFCore/TypesTool.py", line 386, in _queryFactoryMethod
   p = dispatcher[self.product]
File "parts/zope2/lib/python/App/FactoryDispatcher.py", line 46, in __getitem__
   return self.__bobo_traverse__(None, name)
File "parts/zope2/lib/python/App/FactoryDispatcher.py", line 49, in __bobo_traverse__
   product=self.aq_acquire('_getProducts')()._product(name)
 File "parts/zope2/lib/python/App/Product.py", line 84, in _product
   def _product(self, name): return getattr(self, name)
AttributeError: Product.MyProject
Guess: It should read "Products.MyProject".

I guessed that as well, and so I ensured that any "Product." was changed to "Products." in the import and config statements, but still the very same error is returned after the product is installed and any page is viewed (except, of course, "Product" is now "Products" in the error).



_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to