Transaction module is no longer implicitly in Archetypes

by Plone Documentation Team last modified Jun 21, 2009 01:02 PM
In Archetypes 1.3 and 1.4, we imported transaction in the main module to work around a Zope 2.7 issue. Since Zope 2.7 is no longer a supported release, this is no longer the case in Archetypes 1.5 (which is what ships with Plone 3.0). Here's how to update your code.

Typical error message when starting Zope::

from Products.Archetypes import transaction
ImportError: cannot import name transaction

Archetypes no longer imports transaction, so you will have to do it in your own module now, if you are using it. Change occurences of::

from Products.Archetypes import transaction

to::

import transaction

For a live example, see `Poi changeset 40594 <http://dev.plone.org/collective/changeset/40594#file3>`_.