PEATDB/Sandbox.py
def commit(self, user='anon', note=None):
        """Commit change in the DB to zodb.
           We treate conflicts as application level errors, so the
           method returns false if it fails to commit"""
        t = transaction.get()
        t.setUser(user)
        if note==None:
            note='minor'
        t.note(note)
        from ZODB import POSException
        try:
            t.commit()
        except POSException.ConflictError:
            print 'there is a conflict'
            print 'following objects changed: ', self.getChanged().keys()
            #t.abort()
            return False

        return True
Commit change in the DB to zodb.
           We treate conflicts as application level errors, so the
           method returns false if it fails to commit
Commit change in the DB to zodb.
We treate conflicts as application level errors, so the
method returns false if it fails to commit
Commit change in the DB to zodb . We treate conflicts as application level errors so the method returns false if it fails to commit
def commit(self, user='anon', note=None):
        t = transaction.get()
        t.setUser(user)
        if note==None:
            note='minor'
        t.note(note)
        from ZODB import POSException
        try:
            t.commit()
        except POSException.ConflictError:
            print 'there is a conflict'
            print 'following objects changed: ', self.getChanged().keys()
            return False
        return True
def commit ( self , user = 'anon' , note = None ) : t = transaction . get ( ) t . setUser ( user ) if note == None : note = 'minor' t . note ( note ) from ZODB import POSException try : t . commit ( ) except POSException . ConflictError : print 'there is a conflict' print 'following objects changed: ' , self . getChanged ( ) . keys ( ) return False return True
Commit change in the DB to zodb.
Commit change in the DB to zodb .
"""Commit change in the DB to zodb.
           We treate conflicts as application level errors, so the
           method returns false if it fails to commit""" #t.abort()
self
user
note