Hello, I'm trying to put together an External Method that needs to operate on several different objects within the ZDB (a/k/a ZODB, BoboPOS). How do I specify an object ID and retrieve the relevant object? sorry to be obtuse, but I can't find an example anyplace. In the onl;ine docs, this URL -- http://www.digicool.com/releases/bobo/BoboPOS3/BoboPOS3.html -- looked promising, but it comes up empty. Thanks -- Wade Leftwich Okay Network Services, Ithaca NY tel 607-277-1334 fax 607-272-3612
I'm trying to put together an External Method that needs to operate on several different objects within the ZDB (a/k/a ZODB, BoboPOS).
How do I specify an object ID and retrieve the relevant object? sorry to be obtuse, but I can't find an example anyplace. In the online docs
If I have a URL like '/manny/moe/jack', I know that from within the top-level object, I can retrieve the object 'jack' as 'manny.moe.jack'. But if the context is jack, how do I specify the top level so I can talk about manny? Wade Leftwich Okay Network Services, Ithaca NY tel 607-277-1334 fax 607-272-3612
Wade Leftwich wrote:
I'm trying to put together an External Method that needs to operate on several different objects within the ZDB (a/k/a ZODB, BoboPOS).
How do I specify an object ID and retrieve the relevant object? sorry to be obtuse, but I can't find an example anyplace. In the online docs
If I have a URL like '/manny/moe/jack', I know that from within the top-level object, I can retrieve the object 'jack' as 'manny.moe.jack'.
But if the context is jack, how do I specify the top level so I can talk about manny?
The top-level object is the 'app' attribute in the Main module. Note, however, that this will change in ZODB3. import Main Main.app.manny Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
At 12:14 25/03/99 , Wade Leftwich wrote:
I'm trying to put together an External Method that needs to operate on several different objects within the ZDB (a/k/a ZODB, BoboPOS).
How do I specify an object ID and retrieve the relevant object? sorry to be obtuse, but I can't find an example anyplace. In the online docs
If I have a URL like '/manny/moe/jack', I know that from within the top-level object, I can retrieve the object 'jack' as 'manny.moe.jack'.
But if the context is jack, how do I specify the top level so I can talk about manny?
From an external method, self is the object the Externel Method is called from. If you have REQUEST passed in, you can access PARENTS[0], which is the top object. From there you can traverse down the hierarchy.
-- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-6254545 Fax: +31-35-6254555 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
participants (3)
-
Jim Fulton -
Martijn Pieters -
Wade Leftwich