[Zope-CMF] how to repurpose a type programmatically?

Petri Savolainen petri.savolainen at iki.fi
Fri Mar 11 10:07:09 EST 2005


Hello,

I need to repurpose a few content types programmatically, rather than 
ttw via the types tool ZMI. In other words, the FTI id, title, 
description, icon and meta_type would be different in the repurposed type.

I thought typestool.manage_addTypeInformation() would accomplish this 
but it seems that can only be used to register completely new 
class-based types rather than to repurpose existing ones.

I've also tried adding the FTI information for the new types into 
ContentInit that adds the 'base' types I am repurposing. Ie.

  utils.ContentInit(
       PROJECTNAME + ' Content',
       content_types      = content_types,
       permission         = ADD_CONTENT_PERMISSION,
       extra_constructors = constructors,
       fti                = ftis + REPURPOSEDNEWTYPES
       ).initialize(context)

where REPURPOSEDNEWTYPES is a tuple containing the fti dicts for the new 
types. Does not work.

I am starting to wonder if this is possible at all - yet this seems 
something that should be rather easy and common need. What obvious stuff 
am I missing?

Any pointers & advice would be greatly appreciated.

Thanks,

  Petri



More information about the Zope-CMF mailing list