|
Automatic migration for Archetypes schema changes: msg#00091web.zope.plone.archetypes.devel
Hi all-- I have just checked in some semi-experimental auto-migration code for Archetypes. Reinstall Archetypes and go to the archetype_tool. Click on the Update Schema tab. You will see all your types listed. If you click update, an automatic migration script will run and update the schema on all of your objects to the current schema. After that, the archetypes tool will notice whenever your class schema change, and you can run the update as needed on the changed classes. The migration script is kind of dumb (see below for details), so BE CAREFUL if you use this. It works fine for me, but YMMV. Running the unit tests for the automigration will require an additional product called ArchetypesTestUpdateSchema, which I am checking into the Collective. Enjoy Geoff * ArchetypeTool.py: added mechanism for monitoring object schemae. Schema are signed at registration time, and when a schema signature changes, it is flagged in ArchetypeTool._types. Added a new tab on the tool that lets you see which types have schema that have changed and lets you update all the schema in place. You will need to reinstall Archetypes to make this work. * Schema.py: Added toString and signature methods for use with update detection. The toString method could use some improving. Also made a minor fix for the case of validating objects in place. * Field.py: Added toString and signature methods for use with update detection. The toString method could use some improving. * BaseObject.py: Added an automigration method for handling updated schema. The migration method works fine as long as calling a mutator on the value returned by an object's accessor leaves the object unchanged. If you have objects for which this simple migration mechanism won't work, you will need to override BaseObject._updateSchema. * tests/test_update_schema.py: A new test to make sure all the schema updates work. The individual subtests all work when run individually, but something evil in Archetypes is causing POSKeyErrors to be raised when the suite is run. You will need to download the test product ArchetypesTestUpdateSchema for this test to run. ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | mutator not called on empty value?: 00091, Christian Scholz |
|---|---|
| Next by Date: | Re: some issues: 00091, Sylvain Thénault |
| Previous by Thread: | mutator not called on empty value?i: 00091, Christian Scholz |
| Next by Thread: | You are Invited to Attend: 00091, Knowledge Management Solutions |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |