[Zope] Anything like python's "dir" command for Zope?

hans hans@beehive.de
Mon, 03 Jun 2002 10:42:44 +0100


Joel wrote:

> Hi,
>
> One of the things I love most about Python is the ability to quickly drill
> down into any object, to see what attributes it has, what functions it can
> call, and so on. (see below for a demonstration of what I'm talking about.)
>
> I am now learning to use Zope, and am becoming increasingly frustrated trying
> to figure out what various things provide. For instance,
>
> container.objectIds() shows a list of everything in the root directory...
> container.portal_url() shows the base url...
>
> ... and I'm sure that there are a dozen (or a hundred) other things that I can
> do with a container object. How do I find them?
>
> dir(container) doesn't work. It looks to me like the dir command doesn't work
> under Zope, probably for security reasons. Does Zope have anything analagous?
> If not, how *do* you find out what any given object can do?
>
> --Joel
>
> $ python
> Python 2.2 (#1, Feb 24 2002, 16:21:58)
> [GCC 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)] on linux-i386
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import string
> >>> print string
> <module 'string' from '/usr/lib/python2.2/string.pyc'>
> >>> dir(string)
> ['_StringType', '__builtins__', '__doc__', '__file__', '__name__', '_float',

[snip]
it seems to me you are in the dark, but there is light:
advanced:
http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html
more the howto style:
http://www.zope.org/Members/michel/ZB
 especially the appendices
read the source, eg. for Folder:
../lib/python/OFS/Folder.py,
../lib/python/OFS/ObjectManager.py

container.objectIds() shows
  a list if object ids contained in container (root iff container is root)
-------------------------------------------------------------
Who's got only a hammer sees the world as a nail
hans augustin  (software developer)           hans@beehive.de
beehive elektronische medien GmbH       http://www.beehive.de
phone: +49 30 847-82 0                  fax: +49 30 847-82 299