How to get the owner of an object?
I was unable to find the method to get the owner of an object through the Zope APIs. Any info will be appreciated. --Borislav
On Tue, Sep 10, 2002 at 11:22:46AM -0500, Borislav wrote:
I was unable to find the method to get the owner of an object through the Zope APIs. Any info will be appreciated.
--- CUT --- ownerid = None ownerinfo = object.owner_info() if ownerinfo is not None : # at least /Control_Panel/Products[/*] doesn't satisfy the following test if hasattr(ownerinfo, "has_key") and ownerinfo.has_key('id') : ownerid = ownerinfo['id'] --- CUT --- hth Jerome Alet
Jerome Alet wrote:
ownerid = None ownerinfo = object.owner_info() if ownerinfo is not None : # at least /Control_Panel/Products[/*] doesn't satisfy the following test if hasattr(ownerinfo, "has_key") and ownerinfo.has_key('id') : ownerid = ownerinfo['id']
This solves the problem. Thanks. Just curious, where is 'owner_info' documented? I did a search in the Zope online help and found no matches. --Borislav
On Tue, Sep 10, 2002 at 02:36:39PM -0500, Borislav wrote:
This solves the problem. Thanks.
de nada
Just curious, where is 'owner_info' documented? I did a search in the Zope online help and found no matches.
When something isn't documented, just try to read the code. Most is understandable. do a recursive grep on zope/lib/python for "owner", ignoring case, then look inside the rported files bye, Jerome Alet
Borislav wrote:
I was unable to find the method to get the owner of an object through the Zope APIs. Any info will be appreciated.
--Borislav
maybe you look for owner_info... .owner_info()['id'] this will give you the id of the owner of an object. cheers, maik
participants (3)
-
Borislav -
Jerome Alet -
Maik Jablonski