[Zope-CMF] context-sensitive undo form

Tres Seaver tseaver@zope.com
27 Jun 2003 09:56:30 -0400


On Fri, 2003-06-27 at 09:28, Sam Brauer wrote:
> By default, the undo_form shows all transactions (that the user can 
> undo) for the whole CMF site.  It would be nice if it instead showed 
> only the transactions for the current object that the user is working 
> with.  (In the case of a folderish object, I suppose you might want to 
> see all of the transactions recursively under that folder.)  I tried 
> hitting a url like:  http://mycmfsite.org/someobject/undo_form thinking 
> that it would do what I wanted, but that still produces a list of all 
> transactions for the whole site.
> 
> Has anyone customized the undo_form to list transactions in a 
> context-sensitive manner?  Or can someone offer hints about how that 
> might be done?

This can't be done in the general case, because the ZODB doesn't
maintain enough metadata about the transaction to allow it.  The only
metadata it knows is the physical path of the *method* which drove the
transaction;  because of skinning, the method always has the CMFSite
object as its aq_parent, rather than the (?) content object (since some
transactions touch multiple objects, even that would be iffy were it
possible).

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com