c.koll@web.de writes:
When I read the Zopebook it seemed to be quite understandable, but looking at some scripts now, I think I somehow mixed it up. What´s the difference between "this()", "self" and "context"? When do I use each one? "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.
"context" is used in a Python Script. It is the object which was used to access the Python Script. "self" is often used as the first parameter of an External Method. In some cases, calling magic automatically passes an object that is equivalent to "context" for Python Scripts. Read the corresponding sections in <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html> for details. Dieter