Personal tools
You are here: Home Zope & Plone tips Programatically create Zope 2 content
Navigation
 
Document Actions
  • Send this page to somebody
  • Print this page
  • Add Bookmarklet

Programatically create Zope 2 content

by tibi last modified 2007-04-09 14:24

I had a need to create new external methods on install of a product. So, even if technique is old and well know to any Zope 2 old-timer, I'm placing this here for my own reference.

def install(portal):
    portal.manage_addProduct['ExternalMethod'].manage_addExternalMethod(
        id = 'emailMe',
        title='emailMe',
        module='MyProduct.emailMe',
        function='emailMe')
The code needs to interact with a legacy module (renamed here emailMe). The idea is that manage_addProduct returns a dictionary of factories and manage_addExternalMethod is the factory method defined in the ExternalMethod module. Most of the old style Zope content can be added this way.
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: