[Zope] create ZClass instances in Python scripts

Arkaitz Bitorika arkaitz@euskalcom.net
05 May 2001 14:27:02 +0200


Hi,

Is it possible to create programmatically ZClass instances from Python
scripts? I haven't been able to do it.
I have the next thing in my Python script:
    folder.manage_addProduct['MyProduct'].manage_addMyZClass_py(myId)
And then I have a Python Script called "manage_addMyZClass_py" in
"MyProduct" that does simply this:
    container.MyZClass.createInObjectManager(id)
All this gives me the next message:
                   Error Type: TypeError
                   Error Value: not enough arguments; expected 3,got 2
This happens when calling createInObjectManager(), because it expects a
REQUEST object, but I don't have one! It won't accept a None REQUEST
object either.
Any hint?

Cheers,
Arkaitz.