[ZWeb] Call method for the root folder

Jeffrey P Shell jeffrey@cuemedia.com
Fri, 27 Dec 2002 10:28:20 -0700


Hello.

This mailing list is about the Zope.org web site itself, not the Zope 
software.  It's a very small mailing list.  There are more people to 
answer your question on the main `zope@zope.org` list [1]_.

But, I can give you my answer to your question.  You can either:

a) Put the python script that operates on the root in the root
    folder itself, and use the Script binding 'container' to
    access the root object.

b) Put a Python script called 'get_root' in the root folder of
    your Zope instance, with the body::

       return container

    This will return the container of the Python script, which
    in this case would be the root folder.  Then you can call
    that script from your other script via ``context.get_root()``.

.. [1] zope@zope.org mailing list info:
        http://lists.zope.org/mailman/listinfo/zope

On Friday, December 27, 2002, at 07:00  AM, Klimovich Alexander wrote:

> Hi, everybody!
>
> Need your help:
> how to call Zope method for root folder using Python script,
> e.g.
> 'root'.manage_importObject('my_file.zexp')?
>
> I want to import .zexp file into this folder.
> 'context' variable gives parent, but not the root.
>
> Sincerely yours,
> Alexander Y. Klimovich