[Zope-dev] "Overriding Products"
Martijn Jacobs
mart at eastsite.nl
Tue Mar 15 13:49:01 EST 2005
Hello guys.
I have a question regarding product importing in zope 2.7.x, as since
zope 2.7 this part is way more flexible then it was before. I'd like to
accomplish the next situation :
-
A Zope base installation has Product X installed in /lib/python/Products
which I want to change or develop further
-
x instances of Zope use the produtc from this base install.
-
At one instance I want to test and develop, without breaking the other
instances.
-
Copying the Product X folder to the <instance_home>/Products folder is
not an option, as import conflict errors occure if you do not remove the
product from the base installation.
-
Copying a local version in all 4 instances is a solution, but to manage
that will cost alot of work, especially if you have alot of instances.
-
What I really want is that you can copy the Product X folder to the
Products (or "CustomProducts" for example) of an zope instance, and that
zope will figure out itself that it should import that version of the
product instead of the copy in the base installation. 'Overriding' base
products is the name you could give this situation.
I tried alot myself, for example checking in the __init__.py if there is
a copy of this product in <instance_home>/CustomProducts and then
importing that product instead of my own, but I always get into trouble :
AttributeError: 'module' object has no attribute '<Classname>'
It doesn't have to work for all products, only for some of the products
that we are developing ourselfs. We also have a different structure than
normal products as following :
Main Product - Sub product X
- Sub product Y
In the __init__.py of Main product we import and initialize the
subproducts. The idea is to put one of those subproducts in a zope
instance/CustomProducts folder for further development and that the
other instances of zope still uses the base version of the subproduct.
I hope you can help, thanks in advance for your time.
Kind regards,
--
Martijn Jacobs
East Site | Postbus 642 | 6800 AP Arnhem
t: +31 (0) 26 35 14 295 | f: +31 (0) 26 44 20 432
@: mart at eastsite.nl | w: www.eastsite.nl
More information about the Zope-Dev
mailing list