[Zope] Methods inside a ZClass

Tres Seaver tseaver@palladion.com
Sun, 02 Jan 2000 21:14:20 -0600


Jason Spisak wrote:
> 
> I am actually trying to use a management-like interface without the frames.
>  I wanted to see if their was a way to ask for the objects in the "Views"
> tab .

Hmm, the class, ZClass, has a manage_options() method, but it has no docstring,
and so can't be accessed directly from DTML.  An ExternalMethod does the trick,
though.  Place this function in a *.py file in your $SOFTWARE_HOME/Extensions
directory, and voilą:

  def dumpViews( self ):
    """
      Expose the "Views" of a product/ZClass instance's as a tuple of
dictionaries:
    """
    return self.manage_options

You could then iterate over the views in DTML:

  <UL>
  <dtml-in dumpViews mapping>
    <LI> <dtml-var label>
  </dtml-in>
  </UL>

-- 
=========================================================
Tres Seaver         tseaver@palladion.com    713-523-6582
Palladion Software  http://www.palladion.com