I'm getting weirdness with getObject() that i can't find an answer to: i want to troll my catalog to get objects, then interrogate the objects to call methods. In theory i /could/ just shove all the objects in as meta data, but getObject is meant to work me around that. SO here's the problem. <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 ?? or do i have a deeper problem like the fact that my zCatalog is inside a SiteRoot and this is munging the object path ? Help please ---------------------------------------------------------------------------| Geoff Horne http://www.interop.com Senior Network Engineer http://www.ilabs.interop.net ---------------------------------------------------------------------------| "Don't take life too seriously, you don't get out of it alive anyway" Burt Ward
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
participants (2)
-
Dieter Maurer -
Geoff Horne