[Zope] Python Product Initialization

Roché Compaan roche@upfrontsystems.co.za
Thu, 23 Aug 2001 05:51:39 +0200


> =?iso-8859-1?Q?Roch=E9=5FCompaan?= writes:
>  > Is there a way to get a handle on an existing arbitrary object
> in the ZODB,
>  > let's say index_html in the root, through a pyhton product when it
>  > initializes?
>
>    from Zope import app
>
>    root= app()
>    index_html= root.index_html

This is quite neat.  What I did up to now was to get the Zope App through
the product context with:

	app = context._ProductContext__app
      index_html = app.index_html

I jumped into the python debugger on product initialization and inspected
the
context variable and was amazed to see what I could get my hands on (and
what
I could probably break), but your way is more verbose, I like it.

Roché