[Zope-dev] Publishable Objects...

Amos Latteier amos@digicool.com
Thu, 26 Apr 2001 17:30:53 -0700


Brett Carter wrote:
> 
> What does it take to make an object publishable from an
> ExternalMethod?
> I.E., I have a class (see bottom of message) that does some url
> traversal trickery, that works from a python product.  Shouldn't I be
> able to just stick it in an External method, and just return it, i.e.:
> 
> def returnme(self):
>     return MyClass()
> 

Check out the object publishing chapter of the developer's guide

  http://www.zope.org/Documentation/ZDG/ObjectPublishing.dtml

The reason that your example doesn't work is that you are calling the
external method, not using getattr, getitem, or __bobo_traverse__ to
traverse over it. When you call an object you are publishing it, not
traversing over it. In short, you can't traverse over the results of an
External Method.

-Amos

--
Amos Latteier         mailto:amos@digicool.com
Digital Creations     http://www.digicool.com