RE: [Zope] ac_acquire error happens after inheriting from Folder
Hi Dieter, I figured it out after googling around for a few hours. In my manage_addContact method, I'm now getting the object after it's instantiated like so: #instantiate a contact object self._setObject(id, newContact) #get the new instance obj = self._getOb(id) #change permissions based on value of private if private==True: obj.manage_permission('View',['Authenticated','Content Manager','Manager']) else: obj.manage_permission('View',acquire=1) It's still kinda weird though, because when Contact was just a SimpleItem (ie. Not an ObjectManager) I did not need to do this. I was able to write the above as "newContact.manage_permission..." and it worked. At least that's how I remember it. Why is my Contact class considered an acquisition wrapper after inheriting Folder, when prior to this, it was not? Anyhow, for those of you who, like me, are somewhat new to writing Zope products, I've found this site to be pretty useful (particularly chapter 4): http://www.upfrontsystems.co.za/courses/zope/ One more question, when I get my object via self._getOb(id), is that any different than doing dispatcher.getOb(id). If there is difference, what is it and which way is better/worse? Thanks, Tom -----Original Message----- From: Dieter Maurer [mailto:dieter@handshake.de] Sent: Tuesday, February 28, 2006 1:54 PM To: Palermo, Tom Cc: 'zope@zope.org' Subject: Re: [Zope] ac_acquire error happens after inheriting from Folder Palermo, Tom wrote at 2006-2-28 11:25 -0500:
I have a class called Contact that is now inheriting from Folder. After I did this, I get the following error when attempting to add a new Contact:
Exception Type AttributeError Exception Value aq_acquire
Only acquisition wrappers have the "aq_acquire" method. Looks at if your object were not an acquisition wrapper... -- Dieter
participants (1)
-
Palermo, Tom