[Zope] Zcatalog and getObject problem
Dieter Maurer
dieter@handshake.de
Tue, 18 Dec 2001 23:49:59 +0100
Geoff Horne writes:
> ...
> <dtml-in db>
> <dtml-with getObject>
> <dtml-var id>
> <dtml-var foo>
> <dtml-var x_test_method>
> </dtml-with>
> </dtml-in>
>
> When i run this is get a 'KeyError' because x_test_method is not in the
> metadata. ('id' and 'foo' get returned just fine and i can call
> 'x_test_method' from the real object without error). It seems to me like
> getObject() just ain't working.
>
> Am i using getObject() incorrectly...
In principle, you use it correctly...
But, DTML namespaces are sometimes quite confusing.
Try:
<dtml-in db>
<dtml-let ob="_.getitem('sequence-item')">
<dtml-with "ob.getObject()">
...
</dtml-with>
</dtml-let>
</dtml-in>
I expect, that your code happens to get a different "getObject"
than you expect.
The code above does not give it a chance...
Dieter