Hi all, I've created a Product Step which is a subclass of Folder. I want restrict what types of objects I can put in an object of type Step. The "Developer's guide" has this to say on the subject: "If you wish to control which types of objects can be contained by instances of your product you can set the meta_types class attribute. This attribute should be a tuple of meta_types." I naively interpreted this such that I could put this in my class: meta_types = ('Step', 'SURef',) But this gives me the errors: Error Type: AttributeError Error Value: has_key With the backtrace: File /usr/lib/zope/lib/python/OFS/ObjectManager.py, line 271, in filtered_meta_types (Object: Step) So I found a tip on the Web, saying I could do this: meta_types = ({'name':'Step', 'action':'manage_addStepForm'},) Now, this doesn't give me an error, but the effect is that I get one more Step as alternative on the drop-down menu "Select type to add..." *in addition* to all the alternatives. But I wanted to restrict the possibilities, not augment them. What am I doing wrong? TIA Jesper -- Jesper Holmberg |"But how can | jesper.holmberg@enst-bretagne.fr | one be warm | ENST Br, BP 832, 29285 Brest, FRANCE | alone?" |
I've created a Product Step which is a subclass of Folder. I want restrict what types of objects I can put in an object of type Step.
The "Developer's guide" has this to say on the subject:
This is how I am doing it: http://lists.zope.org/pipermail/zope-dev/2001-March/010321.html /Magnus
* On Tue Nov 13, Magnus Heino wrote:
This is how I am doing it:
http://lists.zope.org/pipermail/zope-dev/2001-March/010321.html
Thanks, works perfectly. Seems to me the "Developer's guide" is incorrect, or at least not complete, on this subject. Or perhaps I'm missing something. Anyways, I'm happy. Jesper -- Jesper Holmberg |"But how can | jesper.holmberg@enst-bretagne.fr | one be warm | ENST Br, BP 832, 29285 Brest, FRANCE | alone?" |
participants (2)
-
Jesper Holmberg -
Magnus Heino