[Zope] Add NESTED ZClasses Programatically -- Please Look

Chris Bruce chrisabruce@yahoo.com
Tue, 13 Nov 2001 14:47:50 -0800 (PST)


Ok,

I understand how to add ZClasses in both dtml and Python, thanks all. 
But my problem is that I need to add a nested ZClass to another ZClass.
 Let me explain:

I have a ZClass called ProfileDirectory that extends ObjectManager.

Inside ProfileDirectory, I have another ZClass called Profile. 

The idea is that ProfileDirectory is the folder for Profiles.

Now, in zope I have added a ProfileDirectory (with id=directory) to a
folder (with id=consultants) that looks like:
/consultants/directory

Now I need to Programatically (In a python script) add Profiles to
/consultants/directory

If anybody understands what I just said and can help me, I would be
greatly appreative!!!  

I have tried the following with no luck in a python script:

context.consultants.directory.manage_addProduct['Profile'].Profile_add(_.None,_,NoRedir=1)

context.consultants.directory.manage_addProduct['ProfileDirectory'].Profile_add(_.None,_,NoRedir=1)

context.consultants.directory.manage_addProduct['ProfileDirectory'].Profile.Profile_add(_.None,_,NoRedir=1)

context.consultants.directory.manage_addProduct['ProfileDirectory']['Profile'].Profile_add(_.None,_,NoRedir=1)

context.consultants.directory.manage_addProduct['ProfileDirectory'].manage_addProduct['Profile'].Profile_add(_.None,_,NoRedir=1)

In all cases I get an error saying that Profile is not found.


Thanks,


Chris

__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com