OK, here goes the evil workaround....
It seems that getUser does not return an acquisition wrapped object, so make
your external method this to wrap it (thus giving ownerinfo the ability to
determine the user db):

def setOwner(self, username):
    #note: this assumes that the closest User database houses 'username'
    user = self.acl_users.getUser(username)
    return 'done.'

--Tim McLaughlin (tmclaugh)

-----Original Message-----
From: Magnus Heino (Rivermen)
To: 'Tim McLaughlin'; Magnus Heino (Rivermen)
Sent: 5/11/01 1:20 AM
Subject: SV: Subject: [Zope-dev] change ownership

> could you give me a url, name & pw, and let me take a look at 
> the zclass?

Nope, I'm doing this on my laptop behind a firewall.

But, this is how to reproduce it;

This is my external method:

[magnus@daysleeper Extensions]$ cat
def setObjectOwner(self, username):
        return '%s is now the owner of %s' % (username,
def getObjectOwner(self):
        return self.getOwner()
[magnus@daysleeper Extensions]$

Goto Control_Panel/Products. Add a product 'FooProduct'. Enter the
FooProduct and create a ZClass with id and metatype 'FooClass'.

Enter the FooClass and add a External Method. Set Id and Function Name
'setObjectOwner'. Module name is 'Owner'.

Go to the Root zope folder. It contains a standard acl_users.

Add a FooClass named 'foo'.

Call the external method on the object like this:

magnus is my username that lives in the acl_users.

You get the Attributeerror on aq_inner. 

Any clues? :-P



Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to