[Zope] Versions whats in it

Andy McKay andym@ActiveState.com
Wed, 6 Jun 2001 12:32:29 -0700


Okay I know its bad to answer my own post but I just ran this as an external
method,
and this tells you what object is in a version without having to wander
through the ZMI. Might be a useful function to include on a tab in the
Version object? I'll lob it in the collector

def find(self):
    objects = self.ZopeFind(self, search_sub=1)
    output = []
    for url, obj in objects:
      v = obj.locked_in_version()
      if v != '' and str(v) != '0': # why do some objects have 0 as a
version?
          output.append(v, obj.absolute_url())
    output.sort()

    output_str = 'Version | Object'
    for o in output:
        output_str = output_str + '%s | <a href="%s/manage">%s</a><br>\n' %
(o[0], o[1], o[1])
    return output_str

Cheers.
--
  Andy McKay.