[Zope] Zope context
Bo M. Maryniuck
b.maryniuk@forbis.lt
Mon, 5 Aug 2002 17:31:16 +0200
Hello, all.
Somebody know how to get a Zope Context within Zope Product or External=20
Method?=20
For example, I have an object (e.g. DTML Method) somewhere in Zope, calle=
d as=20
"MyObject". It's might be accessed: http://www.myhost.com/test/MyObject
The problem is, that External Method like this works O.K.:
[test.py (External Method)]
--------8<----------
def foo(self):
=09return self.test.MyObject()
--------8<----------
=2E..but *within a class* -- not:
[test.py (External Method)]
--------8<----------
class bar:
=09def spam(self):
=09=09return self.test.MyObject()
def foo(self):
=09b =3D bar()
=09return b.spam()
--------8<----------
=2E..because I need a context, like:
=09=09return context.test.MyObject()
=2E..but I still can't find how to get it. ;-(
Thank you much.
--=20
Sincerely yours, Bogdan M. Maryniuck
`When you say "I wrote a program that crashed Windows", people just stare=
at
you blankly and say "Hey, I got those with the system, *for free*".'
(By Linus Torvalds)