Hi, This is a subject which has already appeared in the mailing list, but I could not see an outcome, eg: Jeff Kowalczyk jtk@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? TIA Richard Jennings
Richard Jennings wrote:
Hi,
This is a subject which has already appeared in the mailing list, but I could not see an outcome, eg:
Jeff Kowalczyk jtk@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 Cheers, Maik
participants (2)
-
Maik Jablonski -
Richard Jennings