[Setup] Re: Scripting ZOPE/Plone installation

Nick Davis nd51 at le.ac.uk
Fri Sep 29 09:07:40 UTC 2006


Duncan Mortimer wrote:
> Thanks for the quick reply, but it fails with a different error! 
You are, however, making progress.  ;-)

>     db=user.aq_inner.aq_parent
> AttributeError: aq_inner
This is a common acquisition error, when you're doing things that are 
normally done in the ZMI, in a script. I've found sometimes by assigning 
an object to a variable in a script, it somehow loads it, or "brings 
into scope". I have been somewhat in the dark, but sometimes if you try 
to get at:

app.a.b.c.d

it helps if you first say -  x = app.a.b   y = app.a.b.c  etc.

This seems to load stuff in that would've been pulled in automatically 
if you were going via the ZMI.

Failing this, make sure the methods you are calling are not "ZMI-only" 
i.e make assumptions that only hold when you're accessing through Zope.

>> You would find DocFinderTab v useful if you've not already got it.  
>> google for DocFinderTab for more info.
> 
> 
> I'll look into that.
BTW Docfinder tab basically collates all the python docstrings and makes 
them helpfully viewable in the ZMI.

I like your approach to this. Really, it should be easy to construct 
Zope/Plone objects with code, in a tidy modular way, completely seperate 
from the ZMI. But instead its rather tangled up. I daresay Zope 3 fixes 
this but we're not there yet.

Another thing I found hard to get used to, learning this, was the heavy 
use of multiple inheritance.

It helps to use a proper debugger that can step through the Zope 
library/API code, such as emacs (which we use on Linux), or maybe 
BoaConstructor / WingIDE but I don't know those.....

Regards,
Nick

-- 
Nick Davis
Web Application Developer
University of Leicester
http://www2.le.ac.uk
http://ebulletin.le.ac.uk





More information about the Setup mailing list