[Zope] dtml access to "container" within zclass

ra@burningman.com ra@burningman.com
Tue, 20 Aug 2002 03:21:57 -0700


Dieter Maurer wrote:
> Ra writes:
>  > is there any way to gain access to an instance of a zclass from a dtml 
>  > method that is within that zclass?
> When called from ZPublisher (i.e. the Web),
> it should run in the context of this Z instance, i.e. the instance
> is at the top of the DTML namespace.
> You can (under these conditions) use its "this" method to get
> the instance itself.

Alas, "this" isn't working; I get "global name 'this' is not defined".

The problem seems to be that the ZClass instance _isn't_ at the top of 
my DTML namespace.  If it were, I would just be able to refer to my 
other methods directly, using <dtml-with>, like I want to.  It may be a 
bug in LoginManager's LoginUser... my ZClass is subclassing a python 
base class wrapper, which is in turn subclassing LoginUser.

I have another ZClass, subclassing a different python base class.  This 
base class in turn subclasses DataSkin and OFS.Folder.Folder.  The 
problem does not happen in this second ZClass.

-r