[Pypersyst-cvs] pypersyst/pypersyst/entity transaction.py,1.25,1.26 entity.py,1.45,1.46
Brought to you by:
pobrien
From: Patrick K. O'B. <po...@us...> - 2004-06-26 16:09:52
|
Update of /cvsroot/pypersyst/pypersyst/pypersyst/entity In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14133/entity Modified Files: transaction.py entity.py Log Message: Added support for a delete builder. Index: transaction.py =================================================================== RCS file: /cvsroot/pypersyst/pypersyst/pypersyst/entity/transaction.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** transaction.py 26 Jun 2004 16:00:28 -0000 1.25 --- transaction.py 26 Jun 2004 16:09:43 -0000 1.26 *************** *** 135,138 **** --- 135,151 ---- + class DeleteBuilder(Builder): + + def __init__(self, instance, old): + """Create a DeleteBuilder for an entity class using an old + surrogate.""" + self._instance = instance + self.old = old + + def transaction(self): + """Return a delete transaction.""" + return Delete(self._instance) + + class UpdateBuilder(Builder): Index: entity.py =================================================================== RCS file: /cvsroot/pypersyst/pypersyst/pypersyst/entity/entity.py,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** entity.py 26 Jun 2004 15:15:54 -0000 1.45 --- entity.py 26 Jun 2004 16:09:43 -0000 1.46 *************** *** 191,194 **** --- 191,199 ---- txb_create = classmethod(txb_create) + def txb_delete(self): + """Return a transaction DeleteBuilder instance.""" + old = self._surrogate() + return transaction.DeleteBuilder(self, old) + def txb_update(self): """Return a transaction UpdateBuilder instance.""" |