[Zope] Methods inside a ZClass (fwd)

Jason Spisak jason@mtear.com
Mon, 03 Jan 2000 10:24:22 GMT


Zopists,

Just in case our final thread didn't make it to the list, here is an
external method by Tres Seaver to make the ZClass management tabs iterable
in DTML.  It is untested.

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


Thanks again Tres,

All my best,

Jason Spisak