[Zope-CMF] Re: how to repurpose a type programmatically?
Petri Savolainen
petri.savolainen at iki.fi
Sat Mar 12 12:20:20 EST 2005
Oh my. Why, why did I not realize the FTI is a simple PropertyManager so
nothing more complex than a call manage_changeProperties is needed?
"Too much CMF & Plone & AT can make you lose your Zope"?
Petri
Petri Savolainen wrote:
> 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
>
> _______________________________________________
> Zope-CMF maillist - Zope-CMF at lists.zope.org
> http://mail.zope.org/mailman/listinfo/zope-cmf
>
> See http://collector.zope.org/CMF for bug reports and feature requests
>
More information about the Zope-CMF
mailing list