[ZOPE] Newbie: Usage of this(), self, context

c.koll@web.de c.koll@web.de
Wed, 13 Feb 2002 12:00:27 +0100


Dieter Maurer <dieter@handshake.de> schrieb am 08.02.02:
> c.koll@web.de writes:
>  > When I read the Zopebook it seemed to be quite understandable, but lo=
oking at some scripts now, I think I somehow mixed it up. What=B4s the diffe=
rence between "this()", "self" and "context"=3F When do I use each one=3F
> "this" is a method of "SimpleItem.SimpleItem". It returns the object.
>   It is used in DTML Methods, to access the "client".
>   It is also used, to access the nearest acquisition ancestor which
>   is a SimpleItem.
>=20
> "context" is used in a Python Script. It is the object which was
> used to access the Python Script.
>=20
> "self" is often used as the first parameter of an External Method.
> In some cases, calling magic automatically passes an object that is equi=
valent
> to "context" for Python Scripts.
>=20
> Read the corresponding sections in
>=20
>   <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>
>=20
> for details.
> =20
>=20
> Dieter


Thanx for giving me some technical background.

Christian

=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F
All inclusive! 100 MB Speicher, 1000 Mails, Wunschrufnummer, Superstars,
Events, Preisvorteile und mehr unter http://club.web.de/=3Fmc=3D021104