[Zope] How to display the owner of an object?

Jerome Alet alet@unice.fr
Fri, 21 Sep 2001 15:16:38 +0200 (MET DST)


On Fri, 21 Sep 2001, Jan Lentfer wrote:

> I know that this has been a topic on this list before, but what I found in 
> the archives didn't really bring me any further.
> All I want to do ist to display the owner of an object. Is there a way to 
> do this easily?

--- CUT ---
ownerinfo = object.owner_info()
if (ownerinfo is not None) :
  if hasattr(ownerinfo, "has_key") and ownerinfo.has_key('id') :
    owner = ownerinfo['id']
  else :
    # at least for /Control_Panel/Products[/*]
    owner = repr(ownerinfo)
else :
    owner = 'Not owned'
--- CUT ---

hth.

Jerome Alet