[Zope] How does a dtml-method of a ZClass refer to the ZClass instance?

Jean Lagarde jean.lagarde@eer-rc.com
Thu, 28 Jun 2001 11:10:26 -0700


Help!

I think I still have a long way to go to fully grasp the
namespace/acquisition/whereverelsevaluescomefrom structure of Zope (and I
suppose I'll find all of it rather obvious once I 'get it').

Simply put, I would like to access the objectValues (i.e. the contained
objects) of a ZClass instance (based on ObjectManager) from a dtml-method of
the ZClass, no matter what the calling path is, and I just can't figure it
out.

My specific problem is that I am calling the dtml-method of a ZClass
instance from a dtml-document contained in a second instance of that same
ZClass, and no matter what I've tried so far, the dtml-method always ends up
using the objectValues in the second instance. I have verified that the
ZClass dtml-method is called within the context of the instance I want,
because if I insert <dtml-var aPropertyOfMyZClass> in the method, it spits
out the correct value of the property for the instance. What I really need
is to get a hold of the ZClass instance itself, let's call it 'self', so I
can use 'self.objectValues()' inside of my dtml-method. It seems to me that
if I can get to aPropertyOfMyZClass, I should be able to get to the instance
that owns that property, but how?

I know that 'aq_parent' and 'this' are not what I need. I have also tried
'superValues()', and 'getParentNode().objectValues()', just in case.

Any suggestion would be appreciated. I have kept the description of my setup
pretty simple here (there are a few intermediate calls between the dtml
document and the dtml-method of my ZCLass); I can provide more details as
required.

Also, nobody has volunteered to answer my question at
http://groups.yahoo.com/group/zope/message/64321; given the flow of messages
on this list queries quickly get lost, so I hope that this reminder will get
me a reply or two ;-)

Cheers,

Jean