Re: [Zope] Getting an object from it's id

2001-01-23 Thread Erik Enge
[[EMAIL PROTECTED]] | Is there a Zope API method that will allow me to get an object from | it's id, or can I write a simple Python method to do it, or am I | missing something even more obvious? Well, sometimes objectItems or objectValues can be the right ones to use. Other times, (in Python

Re: [Zope] Getting an object from it's id

2001-01-23 Thread Oleg Broytmann
On Tue, 23 Jan 2001, Gale wrote: dtml-in expr="objectValues('Folder')" dtml-if "myId==id" 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

Re: [Zope] Getting an object from it's id

2001-01-23 Thread Geoff Armstrong
on 1/23/01 12:34 PM, Oleg Broytmann at [EMAIL PROTECTED] 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

Re: [Zope] Getting an object from it's id

2001-01-23 Thread Andrew Kenneth Milton
+---[ Geoff Armstrong ]-- | on 1/23/01 12:34 PM, Oleg Broytmann at [EMAIL PROTECTED] wrote: | | 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." if objectname is actually a variable with the

Re: [Zope] Getting an object from it's id

2001-01-23 Thread Ivan Cornell
Geoff Armstrong wrote: 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

RE: [Zope] Getting an object from it's id

2001-01-23 Thread Max Møller Rasmussen
From: Geoff Armstrong [mailto:[EMAIL PROTECTED]] 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." Shure there is: dtml-var "some_container_object[remote_id].title" As far as I remember. regards Max M A snippet I use

Re: [Zope] Getting an object from it's id

2001-01-23 Thread Geoff Armstrong
on 1/23/01 1:12 PM, Erik Enge at [EMAIL PROTECTED] wrote: Thanks; but being new to this could you help me a bit more by providing an example of how to use 'getOb' within dtml code. I tried testing in; but couldn't get it work. Geoff [[EMAIL PROTECTED]] | Is there a Zope API method that

Re: [Zope] Getting an object from it's id

2001-01-23 Thread Geoff Armstrong
on 1/23/01 1:20 PM, Ivan Cornell at [EMAIL PROTECTED] wrote: Hi Ivan, Thanks. The "_.getitem(myId)" works well. I've made a note of the "hasattr" trick as well for future reference. Geoff Geoff Armstrong wrote: What I'm trying to do here is avoid using dtml-in, since in order for it to