Hi,
I'm working on a policy product which creates some content during installation. I have a custom folderish content type "Queue" which I want to add some instances of.

The code check if there is already an object with the id, and only creates if that isn't the case. I was happy having my unit tests pass, unti I've started my Plone site and manually installed/ uninstalled the policy product.

It happens that on installation content gets created as desired.
But on uninstall, the objects get deleted (wtf)


The code looks as follows:

<snip>
def create_content(portal):
    """ Creates queues and sets them to state active """

    logger.info("********** create content")
    wf = getToolByName(portal, 'portal_workflow')
    for item in CONTENT:
        if item['id'] in portal.objectIds():
logger.info("Object %s already created , pass" % item['id'])
        else:
            portal.invokeFactory('Queue',
                    item['id'],
                    title=item['title'],
                    description=item['description'])
            queue = getattr(portal, item['id'])
            wf.doActionFor(queue, 'activate')
            logger.info("%s created" % item['id'])
<snip>


Is this some new functionality that setuphandlers get a magic reverse or am I missing something?

Thanks for any hints.



--
mr_savage
Hans-Peter Locher
InQuant GmbH
http://www.inquant.de



_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to