[Zope] All previous of a document

Sedat Yilmazer sedat@kibele.com
Fri, 29 Jun 2001 18:19:06 +0300


How Can I find previous versions ( versions that was overwritten) of a =
document? There is the undo command that can undo an action to get you =
back to the previous version, so the data is somehow there. Problem is =
How can I reach that data without performing an undo.

 Sedat Yilmazer

-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Andy
McKay
Sent: Wednesday, June 06, 2001 10:32 PM
To: Andy McKay; zope@zope.org
Subject: Re: [Zope] Versions whats in it


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 =3D self.ZopeFind(self, search_sub=3D1)
    output =3D []
    for url, obj in objects:
      v =3D obj.locked_in_version()
      if v !=3D '' and str(v) !=3D '0': # why do some objects have 0 as =
a
version?
          output.append(v, obj.absolute_url())
    output.sort()

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

Cheers.
--
  Andy McKay.


_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -=20
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )