[Zope] All previous of a document

Casey Duncan cduncan@kaivo.com
Fri, 29 Jun 2001 10:25:56 -0600


Sedat Yilmazer wrote:
> 
> I mean how can I access the older versions of a given document from dtml/python
> something like
>   olddoc=doc.previous_version

You can use the manage_change_history method of an object to return a
list of mappings describing each historical revision. With that, you can
retreive a revision using the HistoricalRevisions attribute, which is
like a dictionary.

For example, to retreive the last revision use:

revisions = obj.manage_change_history()
return obj.HistoricalRevisions[revisions[0]['key']]

or from dtml:

<dtml-var expr="HistoricalRevisions[manage_change_history()[0]['key']]">

hth,
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>