[Zope] how to get info about an object (dir/type)

Dieter Maurer dieter at handshake.de
Thu Jun 30 16:35:27 EDT 2005


Peter Bengtsson wrote at 2005-6-30 13:36 +0100:
> ...
>External methods. You might even want to have a general debugging
>script lying around that you can use to exploit dir() and type() and
>__class__.__name__ from your zope.
>Bare in mind that there's a security reason why these aren't available
>in zope but if it's only you using the tools, it's safe.

You can also use your favorite tools in an interactive
Python interpreter session.

Under *nix, it looks like:

      bin/zopectl debug
      obj = app.unrestrictedTraverse(path_to_some_interesting_object)
      dir(obj); type(obj)
      u = obj.getUser(...)
      dir(u)
      ...

You must either use ZEO or shut down you Zope while you access it
like shown above...

-- 
Dieter


More information about the Zope mailing list