[Zope] Adding Folders, Scripts, and Documents Using the Command Line

Dieter Maurer dieter@handshake.de
Fri, 13 Sep 2002 19:48:01 +0200


Joseph Griffin writes:
 > That How-To (it seems to me) was more of a
 > administrative process (and a good one).
You are right: it is *more* administrative but nevertheless answers your
problem:

  In the debugging section, you find:

     ./zctl.py debug
     # the root application object is bound to 'app'
     # ...

   This means "app" is the root object of your Zope Web site.

   You can (usually) use attribute access to access other objects
   in your Zope site. You can use the standard API functions
   to create/modify objects in your Zope site.
   Do not forget to commit the transaction.

   I expect, you are able to import resources from Python modules
   (such a functions) and do more complex tasks.

Look at

  <http://www.dieter.handshake.de/pyprojects/zope>

You will find a module "debugging support". Look at its source.
You will find out how you can create a REQUEST object. This
is sometimes necessary, as attribute access not always gives
you the same result than traversal. With a REQUEST object,
you can use the "traverse" method to do real traversal.


Look at the "zctl.py debug" code to learn how to avoid the interactiveness
and be fully automatable.



Dieter