Hi, I've been working on my Zope product almost entirely through the ZMI (it's pretty GUI intensive), but I'm reaching a point where I need to refactor and make a lot of modifications, so I've just started to work from the Python interpreter. I've set up the environment correctly (the same as I set up in "start" -- I have an "Instance" style installation of Zope), shutdown the service (to avoid a ZODB conflict), and got as far as:
import Zope import Products from Interface import *
successfully. I've been using the Interface tools to examine my classes, but I really want to examine the instances. I can create new instances in memory by just calling the constructor:
my_instance = my_class()
but I have some (time) expensive stuff installed into the ZODB already -- it'd be nicer to just access the existing instances. Is that possible? Because so far, I haven't found where the "Root Folder" is imported. My understanding is that once I have the root object to the ZODB/OFS that I'll be able to access everything else by examining attributes, but I don't know how to get the top level object. (And I assume I must be able to access it, because why else would there be a conflict?) I figure I'm probably not looking at the right documentation for that, and hoping someone on the list knows. Thank you, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com
but I have some (time) expensive stuff installed into the ZODB already -- it'd be nicer to just access the existing instances. Is that possible? Because so far, I haven't found where the "Root Folder" is imported. My understanding is that once I have the root object to the ZODB/OFS that I'll be able to access everything else by examining attributes, but I don't know how to get the top level object. (And I assume I must be able to access it, because why else would there be a conflict?)
iirc
import Zope app=Zope.app()
app is now your root, and we can do stuff with it. do a dir(Zope), and look for start* to get zope to start normally.. (can;t remember off the top of my head) check the list for many reference to doing this hth
I figure I'm probably not looking at the right documentation for that, and hoping someone on the list knows.
Thank you, Terry
-- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- Open WebMail Project (http://openwebmail.org)
On Tuesday 29 April 2003 06:43 pm, Bakhtiar A Hamid wrote:
Terry Hancock:
I haven't found where the "Root Folder" is imported. My understanding is that once I have the root object to the ZODB/OFS that I'll be able to access everything else by examining attributes, but I don't know how to get the top level object. (And I assume I must be able to access it, because why else would there be a conflict?)
iirc
import Zope app=Zope.app()
app is now your root, and we can do stuff with it.
THANK YOU!! That's it. dir(Zope) gives a bewildering array of choices, (also some of the examples suggest it might be in ZPublisher, etc). So this is not at all obvious, and I couldn't find any mention of it in the Zope Developer's Guide. It tells all about what to do with a root ZODB object, but not how to get the first one! Or at least, if it does, I couldn't find it. I'm off to go add a comment. ;-) Thanks again, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com
participants (2)
-
Bakhtiar A Hamid -
Terry Hancock