[Zope] Object method calling rules

TFE MMS JARVIS JOHN jarvis.sd082@ex.tel.co.jp
Thu, 27 May 1999 13:02:14 +0900


Hi all,
After being pulled away for a bit, I'm finally back to Zopeing. Yay!

I know this is explained somewhere, but I can't seem to find where...

I have a Product that looks something like:

class myProduct(
...
)
...

    view_html=HTMLFile('viewProduct',globals())
...
    def __call__(self,REQUEST=None):
        return self.view_html(self,REQUEST)
...

So I can use <!--#var myObjectInst--> to render it.
I can also use <!--#call "myObjInst.aMethod()"--> to call a method.

My objects have part numbers of the form 'xxx-xxxxx-xx' as id's, so 
they have to be expressed as _['xxx-xxxxx-xx'] in python expressions.
What I don't understand is why <!--#call "_['myObjInst'].aMethod()"-->
returns an error: 'string' object has no attribute 'update_properties'
By searching my mail archive, I found that I can use
_.getitem('myObjInst',0)
so that <!--#call "_.getitem('myObjInst',0).aMethod()"--> works.

My question: what is the difference between myObjInst and _['myObjInst']?
 _['myObjInst'] calls the __call__ method?

Pointers to pertinent documentation would be greatly appreciated (I 
know it exists--I've read it once before :^)

TIA,
John Jarvis