[Zope] frustrated by inability to introspect...

Skip Montanaro skip@pobox.com
Fri, 25 Oct 2002 22:54:33 -0500


I have the following little snippet of pt code:

    <form action="edit_list">
        <select name="listname">
          <option tal:repeat="item container/enumerate_lists"
              tal:content="item">list</option>
        </select>
        <input type="submit" value="Edit">
    </form>

container/enumerate_lists is a ZSQL method that performs a simple query:

    select listname from mailinglists

All I want to do is display the listnames as form option values.  I can't
figure out what attributes "item" has.  The dir() builtin isn't exposed as
far as I can tell.  I've been wandering all over the Zope Book for about 20
minutes and have so far been unable to find the attributes associated with
the "item" object.  Where should I be looking?  Is there a rough Zope
equivalent to

    >>> dir("abc")
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__ge__', '__getattribute__', '__getitem__', '__getslice__',
    '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__',
    '__mul__', '__ne__', '__new__', '__reduce__', '__repr__', '__rmul__',
    '__setattr__', '__str__', 'capitalize', 'center', 'count', 'decode',
    'encode', 'endswith', 'expandtabs', 'find', 'index', 'isalnum',
    'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper',
    'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex',
    'rjust', 'rstrip', 'split', 'splitlines', 'startswith', 'strip',
    'swapcase', 'title', 'translate', 'upper', 'zfill'] 

or

    >>> print "".capitalize.__doc__
    S.capitalize() -> string

    Return a copy of the string S with only its first character
    capitalized.

?

Thx,

-- 
Skip Montanaro - skip@pobox.com
http://www.mojam.com/
http://www.musi-cal.com/