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.
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
Contributors
Tom Blockley Alan Hoey Matthew Wilkes
Sponsored by
Team Rubber, Bristol
Metadata
Release files for collective.diversion 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| collective.diversion-1.0.zip | 26.7 kB | Without provenance | Details for collective.diversion-1.0.zip |
Release files / collective.diversion-1.0.zip
| Download URL | collective.diversion-1.0.zip |
|---|---|
| Size | 26.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd8b4cfd6ff5d2f0dbca0c872564e69c78f3faa70fe3823e497effea881d140b
|
|
BLAKE2b-256 checksum How to use checksums |
c45e1fbdef96f300c410d7e01adf42b9aaf82848b9bf844fcd358e1957478d3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for collective.diversion 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.