Back to index

plone3  3.1.7
Functions
plone.locking.events Namespace Reference

Functions

def lockOnEditBegins
def unlockAfterModification

Function Documentation

def plone.locking.events.lockOnEditBegins (   obj,
  event 
)
Lock the object when a user start working on the object

Definition at line 8 of file events.py.

00008 
00009 def lockOnEditBegins(obj, event):
00010     """Lock the object when a user start working on the object
00011     """
00012     lockable = ILockable(obj)
00013     if not lockable.locked():
00014         lockable.lock()

Release the DAV lock after save

Definition at line 15 of file events.py.

00015 
00016 def unlockAfterModification(obj, event):
00017     """Release the DAV lock after save
00018     """
00019     lockable = ILockable(obj)
00020     if lockable.can_safely_unlock():
        lockable.unlock()