Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install collective.diversion

How to install collective.diversion

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install collective.diversion
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
1.0 Available View build log
 
License
GPL
Dependencies
Lastest release
version 1.0 on May 7th, 2013

collective.diversion

collective.diversion wraps the existing behaviour for broken objects in the ZODB and provides a lookup table that will be processed in advance of passing down requests. This allows developers to declare old locations of their classes and have them be automatically and seamlessly migrated to the new code on load.

https://secure.travis-ci.org/collective/collective.diversion.png?branch=master
Usage

Simply include the following ZCML declaration in your code:

<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:diversion="http://namespaces.plone.org/diversion">

    <diversion:class
        old="Products.example.oldlocation"
        new="collective.example.shiny"
        />

</configure>
Caveats

Diverted classes will persist their new class when they are written. However, when ZODB stores references to persistent objects it stores both the oid and the name of the class. Those class name references will only be updated when the persistent object they are attached to is re-serialised (modified). Unfortunately this package cannot do this for you as there is no way to find the set of objects which reference a particular object (quickly). You'll have to leave the diversion directives in your package until you can confirm that all instances and all references have been updated. Changelog =========

1.0 (Unreleased)
  • Overrides the cPickle.Unpickler class in ZODB ExportImport to allow for copy/paste as well as export. (MatthewWilkes)
  • Rebind the class factory to existing DB connections on initialization (MatthewWilkes)
  • ZCML declaration to register diversions
  • Implementation of classFactory that uses diversions

System Message: WARNING/2 (<string>, line 43)

Bullet list ends without a blank line; unexpected unindent.

Contributors

Tom Blockley Alan Hoey Matthew Wilkes

Subscribe to package updates

Last updated May 7th, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.