[Zope] Best way to have special objects in my products produc list?

Dieter Maurer dieter@handshake.de
Wed, 16 Jan 2002 19:32:33 +0100


Lennart Regebro writes:
 > From: "Dieter Maurer" <dieter@handshake.de>
 > > I use an appropriate "all_meta_types" method in my "container" products.
 > >
 > > Why? I did not yet meet a simpler way...
 > 
 > As I understand it all you can do there is to filter out meta_types. I need
 > also to include a meta_type.
You do not understand right:

  You can add information to create
  Zope objects that are nowhere (else) registered. Like that:

      def all_meta_types(self):
        return (
          {
          'name' : TopicConfig.meta_type,
          'action': 'TopicConfig_add',
          'permission': ManagePortal,
          },
          )
    
 > If I just add in a meta_type that product isn't registered, and so has no
 > icons and so on, so I need some type of registration too, right?
If you want that your object has an icon, give it (more precisely: its class)
one:

	icon= ImageFile(....)

"ImageFile" comes from "App.ImageFile".

It is only that registration does this for you as a side effect.
Registration is not necessary for a class to get an icon.


Dieter