[Zope-dev] need a LocalUndo management tab

Michel Pelletier michel@digicool.com
Sun, 27 Feb 2000 22:13:31 -0800


Damian Morton wrote:
> 
> Hi Peeps,
> 
>         Im just getting started with Zope and one of things I think would be
> extremely usefull would be a LocalUndo subclassable object. Essentially,
> subclassing from this LocalUndo object would add a LocalUndo property page
> which would enable a manager to undo operations related to this object and
> this object only. A variation of this feature would be to enable undo
> operations on this object and its subobjects.

Good idea, not as easy as it sounds though.  First, you don't undo
object, you undo transactions, and any number of object may change in
one transaction.  This is just one possible difficulty to surmount.

I'm not saying it's not possible, it just might require quite a bit of
deep thinking about doing it the right way.  This is definatly a Jim
department, although I've been spending a bit of time researching how
ZODB works down at the scientific level.

>         My Python is pretty good, and I'm not averse to delving into the source. If
> anyone has any tips or pointers on how to approach creating this feature, Id
> greatly appreciate it.

Well, the undoLog (where the list of undoable transactions come from)
comes from the actualy storage system itself (since it's possible that
hypothetical storages (and real ones, such as Ty Sarna's Berkeley
storage) many not support undo...).  Check out
lib/python/ZODB/FileStorage.py and start looking at the undoLog method. 
This is agood place to start to see how undo works in Zope.

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