[Zope] inheritance and aqusition question

Roman Klesel roman_plonemail at lotuseyes.de
Fri Feb 3 08:04:49 EST 2006


Hello Andrew,

thanks for your reply.

Andrew Milton schrieb:
> 
> One (or more) of the following two;
> 
> Your class isn't yet fully instantiated and Acquisition wrapped, this normally
> doesn't occur until your class is inside the ZODB. 

That's true! And it's nor supposed to be. It's only a temporary Object that's being destroyed
after the method in which it's created has finished processing.

>You generally need to use a
> 'post init' method to do a 2-stage init so that subitems can acquire items.
> There are Zope hooks you can use (manage_afterAdd), or you can call your
> own methods in the "manage_add" Factory method of your product.
> 
> If this is what you are doing then it's probably;
> 
> The importSingle class must be an attribute of the Controller class for
> Acquisition to work in this way. 

I wouldn't like to do that either, because I don't want that object to persist.

Probably I just do things in the wrong way. What I wnat to do is:

In the temporary object:

try:
   h=open('file',r)
except:
   em = 'File %s does not exist' % file
   return REQUEST.RESPONSE.redirect(self.manage_editSettings(REQUEST), em)

the calling Object then would pass it to the browser ...

... in order to do some exception handling.

is there an other way to redirect to the settigs Form when an error occurs in this nonpersistent object?

Greetings Roman



More information about the Zope mailing list