[Zope] Getting an object from it's id
Geoff Armstrong
geofstro@monaco.mc
Tue, 23 Jan 2001 13:02:25 +0000
on 1/23/01 12:34 PM, Oleg Broytmann at phd@phd.pp.ru wrote:
> On Tue, 23 Jan 2001, Gale wrote:
>> <dtml-in expr="objectValues('Folder')">
>> <dtml-if "myId==id">
What I'm trying to do here is avoid using <dtml-in, since in order for it to
put the object in the namespace it has to iterate over all of them (there
could be any number).
All I have at the beginning is the name of the object in the REQUEST part of
the namespace as picked up from a form. My method is the action to that
form.
In DTML there doesn't seem to be a way of saying, "I have this string with
the name of an object, now fetch me the object."
Geoff
>
> You don't need to "get" the object, as the object is already on top of
> the namespace stack (dtml-in put the object there on every iteration). Just
> use the object's attributes (id, after all, is just yet another attribute).
>
> Oleg.
> ----
> Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru
> Programmers don't die, they just GOSUB without RETURN.