[Zope] migrate zclass to disk product
Max M
maxm@mxm.dk
Fri, 24 Jan 2003 09:31:18 +0100
Lee Harr wrote:
> Hi;
>
> Anyone have any pointers for migrating a product from zclass
> to disk-based?
Yes. Use the Easyproduct to create the product:
http://www.zope.org/Members/maxm/HowTo/easyProduct
> My best thought so far is just to hide the ZClass (Make
> its "Add list name" a blank string) then create a new disk
> product which takes over the "Add list name".
No. You create a new product, preferably with a new metatype. Then you
write an external script that finds all instances of your zclass and
converts them to the new disk based product.
You do this by copying the old values to an instance of the new product.
Then you delete the old object, and save the new instance with the same id.
# hint!
# ZopeFind finds every object in Zope with certain metatypes
objects = self.ZopeFind(self, obj_metatypes=[meta_type], search_sub=1)
for path, obj in objects:
# convert objects here
regards Max M
--
hilsen/regards Max M
http://www.futureport.dk/
Fremtiden, videnskab, skeptiscisme og transhumanisme