Re: [Zope-dev] Getting Zope root object without object context.

2002-11-06 Thread Gilles Lenfant
> Gilles Lenfant wrote:
> >
> > I know I can get the root object using self.getPhysicalRoot()
> > But I'm in a situation where I can't get that "self" or any other Zope
> > object.
>
> Sounds like a very strange situation, tell us more about it...
>

Not that strange...

I need to get the Zope root object at startup in a FS product to get some
configuration data.
As this runs without any object context in an __init__.py, I can't rely on
any context Zope object.
But I found the workaround:

import Zope
...
root = Zope.app()

Gives the same thing as self.getPhysicalRoot()

Cheers

--Gilles

> cheers,
>
> Chris
>
>
> ___
> Zope-Dev maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
>
>



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Getting Zope root object without object context.

2002-11-06 Thread Chris Withers
Gilles Lenfant wrote:


I know I can get the root object using self.getPhysicalRoot()
But I'm in a situation where I can't get that "self" or any other Zope
object.


Sounds like a very strange situation, tell us more about it...

cheers,

Chris


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope )