[Zope] general API question

Jonathan Hobbs toolkit at magma.ca
Mon Sep 27 17:44:17 EDT 2004


From: "David Evans" <dsevans at berndtgroup.net>
> On Mon, 2004-09-27 at 13:24, Dieter Maurer wrote:
> > David Evans wrote at 2004-9-26 15:57 -0400:
> > > ...
> > >is there a more complete API reference available, and if not how can
> i
> > >contribute to the update of the curent API to a more complete status?
> >
> > You can ask Zope to show you (most of) the request attributes.
> >
> > In "ZPT" it looks like:
> >
> >    <div tal:content="structure request" />
> >
> > in DTML is it:
> >
> >    <dtml-var REQUEST>
>
> Thanks, thats definately helpful. However, i was really looking for
> something more formal.  A listing of all methods and attributes of the
> class and the parameters and return types of the methods. I found
> something close at:
> http://ingo.fargonauten.de/epydoc/
>
> but the ZPublisherHTTPRequest class listed does not list the "form",
> "cookies" or "other" attribute. I looked in the zope directory on my
> server and found:
> lib/python/ZPublisher/HTTPRequest.py
>
> this seems to be the class printed by:
> <div tal:content="structure request" />
>
> so maybe the answer to my question is "read the f-in source code" :)

To get info on a specific Product/Module (for which no documentation is
readily at hand) you can create a 'quick and dirty' external method which
contains:

from Productxxx import Moduleyyy
def getInfo(self):
    return str(dir(Moduleyyy))


This would return a list of the attributes of Moduleyyy. You can then append
the attribute name to the Module name to drill down, eg.

    return str(dir(Moduleyyy.attrA)

You can use the 'Test' tab on the external method object page in the ZMI to
quickly run the external method.


HTH

Jonathan






More information about the Zope mailing list