[Zope] creating ZClass instances from an external method
Maik Röder
roeder@berg.net
Wed, 15 Nov 2000 10:04:42 +0100
Hi Gary !
Gary Reynolds wrote:
>
> I have a need to do some creating of objects from python code.
>
> Am I correct in thinking that to add a new object, that is one of my
> products, I need to do something like:
>
> folder.manage_addProduct['ProductName'](id='foo', title='bar')
>
> I have sample code to create simple things like using
> manage_addDTMLMethod, etc, but nothing for a product.
>
> The way I've got my data stored is in a combination of dictionaries
> and lists... it was an ugly enough process to export it - now
> importing it seems worse.
>
> Any help would be appreciated.
You may want to export your data into an XML file and reimport
that. I will write an external method that creates a ZClass
for a tag and an attribute for a property. The code already
works for creating Folders, so have a look at my XML2Zope external
method. http://www.zope.org/Members/roeder
I have written some related notes on my weblog:
http://uzopia.editthispage.com/2000/11/15
Best regards,
Maik Röder