[Zope] converting objects from one type to another ...

Darran Edmundson Darran.Edmundson@anu.edu.au
Mon, 18 Oct 1999 20:42:38 +1000


I have created a ZClass called DImage which acts as 
a container for multiple Image objects and files.  
(I use it to store the same image at different 
resolutions and in different formats.)  What I need to 
do now is convert all of my existing images over to 
this new object type.  As a Zope Image instance only 
contains one image, the DImage instance will similarly
contain one image.

I have toyed with the idea of exporting my Images in
XML format and then making changes to this text file
before reimporting.

Possibly it would be easier to write an external
method that creates a new DImage instance, populates
it with data from the Image, deletes the Image,
and then renames itself.

Any advice are pointers to solutions that I can
use for inspiration and code are appreciated.

Cheers,
Darran.

-- 
Darran Edmundson [Darran.Edmundson@anu.edu.au]