[Zope-dev] RFC: product initialization cleanup and improvements
yuppie
y.2005- at wcm-solutions.de
Thu Oct 27 08:45:21 EDT 2005
Hi!
Working on the five:registerClass directive for Five 1.2 and Zope 2.9 I
had a closer look at the product initialization code.
I propose the following modifications for the dicts in
Products.meta_types (set by registerClass):
1.) 'action' key:
-----------------
I'd like to give empty 'action' values a special meaning: The meta_type
is not visible in the add drop down in the ZMI.
The five:registerClass directive allows to set empty 'action' values.
This would resolve http://www.zope.org/Collectors/Zope/1885 .
Filtering out meta_types with empty 'action' values is a two line change
in main.dtml. I'd like to make that change also on the 2.8 branch to
enable that feature for 2.8.5 with Five 1.2.
2.) 'interfaces' key:
---------------------
Does currently only contain oldstyle interfaces. The code in
OFS.ObjectManager that uses that key works also with z3 interfaces. I'd
like to add z3 interfaces to the value of that key. That would e.g.
allow to set only new style interfaces on catalog index classes.
3.) 'product' key:
------------------
AFAICS it isn't used in Zope itself. I'd like to add a note that it
might be removed in a future version.
4.) related cleanup:
--------------------
Application.install_product has some backwards compatibility code for
products that have initialization code outside the 'initialize' method
of their __init__.py. This is deprecated at least for 5 years. I'd like
to add explicit deprecation warnings on the 2.8 branch and to remove
that code for Zope 2.9.
This isn't much work, it can all be done in time for the Zope 2.9 beta.
Any feedback is welcome. If there are no objections, I'll make the
changes as proposed.
Cheers,
Yuppie
More information about the Zope-Dev
mailing list