[Zope] self=self.this() !!

Dieter Maurer dieter@handshake.de
Tue, 26 Jun 2001 05:24:56 +0200 (CEST)


"Sedat Yilmazer" <sedat@kibele.com> writes:
 > What is the meaning
 > self = self.this()

Whenever you call an acquired normal method, then part of
the acquisition context is stripped from the passed in "self"
such that "self.aq_self" is the object, that defines the method
(i.e. it does not acquired it).

Therefore, despite the definition,
	   
	   def this(self): return self

self= self.this() has an effect: 

  After the assignment, "self" is an object that defines
  the "this" method and no longer an object that only
  acquires it.

In a standard Zope setup, "this" is defined by the
Zope site building objects (Folder, Script, DTML object, ...)
and not by auxiliary classes.
In this case, you can use "this()" to get at the nearest
Zope site building object.


Dieter