You wrote 21 èþíÿ 2005 ã., 20:27:50:
> Denis Mishunoff wrote:
>> I have a problem with my product.
>> I use Zope 2.7.5 and Plone 2.0.5.
>> I need to create the copy of Document content-type on my product's
>> install the same way as it is done in portal_types via
>> "Factory-based Type Information" option of dropdown.
>> I just need to have the copy of it and to alter some fields.
> Here's some code I stole from Chapter 8 of my book, were a
> Folder-derived type is created in an install script::
> from Products.CMFCore.Expression import Expression
> # Customize types
> # New 'NewsFolder' type based on folder
> add_meta_type="Factory-based Type Information",
> typeinfo_name="CMFPlone: Plone Folder")
> nf = getattr(types_tool, 'NewsFolder')
> allowed_content_types=('News Item',))
> for a in actions:
> if a.id == 'view':
> a.action =
> After a clone of the type is made based on Plone Folder, some changes
> are made: contents are filtered, and only News Items are allowed; also
> an action is changed to point to a custom template.
> This is a better option than using the copy/paste API like you might do
> in the ZMI.
Thank you very much, Cameron. Definitelly will use it next time. This
time I decided to create the separate content type, because seems like
I will need to change some methods of it. But I will definitelly use
your solution next time ;)
Denis Mishunoff mailto:[EMAIL PROTECTED]
Zope maillist - Zope@zope.org
** No cross posts or HTML encoding! **
(Related lists -