[Zope] Re: _allowed_meta_types

Richard Jennings rjennings at stradefi.com
Thu Oct 9 03:27:18 EDT 2003


Yep, that does it!
I guess I should have realised it, but I hadn't made the connection between the
'all_meta_types' method and the add products drop down.

Now what worries me is the construct:
	'if meta_type['name'] in self.selected_meta_types:'
if self.selected_meta_types was a dictionary, I could understand it but it isn't, its
a list.  This should cause a 'not integer' error.  There is something here I haven't
grasped and I'm probably being dumb, so please enlighten me.

Thanks, Richard

> > This is a subject which has already appeared in the mailing list, but I
> > could not see an outcome, eg:
> >
> > Jeff Kowalczyk jtk at adelphia.net
> >  Wed, 1 May 2002 01:09:20 -0400 et al.
> >
> > I have some meta_types which depend on some services which can be
> > started/stopped. It would be elegant to stop the addition of instances
> > when the services are not running by adding and removing the classes from
> > the add list, as appropriate.
> >
> > Has anybody solved the problem of modifying the add-list
> > programmatically?
>
> You must declare a method called all_meta_types(self) in your
> ObjectManager / Folder, which returns a list with the metatypes you want
> to allow to add. You can find a working example in:
>
> http://www.zope.org/Members/mjablonski/PropertyFolder




More information about the Zope mailing list