Ñò ‰„[Jc @ sü d Z d d k l Z l Z l Z d d k l Z l Z d d k l Z d d k l Z e Z e Z d e i f d „ ƒ YZ d e f d „ ƒ YZ e i e ƒ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d S( sd The internals for the Unit Of Work system. Includes hooks into the attributes package enabling the routing of change events to Unit Of Work objects, as well as the flush() mechanism which creates a dependency structure that executes change operations. A Unit of Work is essentially a system of maintaining a graph of in-memory objects and their modified state. Objects are maintained as unique against their primary key identity using an *identity map* pattern. The Unit of Work then maintains lists of objects that are new, dirty, or deleted and provides the capability to flush all those changes at once. iÿÿÿÿ( t utilt logt topological( t attributest interfaces( R ( t _state_mappert UOWEventHandlerc B s2 e Z d Z d „ Z d „ Z d „ Z d „ Z RS( sd An event handler added to all relation attributes which handles session cascade operations. c C s | | _ d S( N( t key( t selfR ( ( s= /usr/lib/python2.6/site-packages/sqlalchemy/orm/unitofwork.pyt __init__% s c C s^ t | ƒ } | oG t | ƒ i | i ƒ } | i i o | | j o | i | ƒ qZ n | S( N( t _state_sessionR t get_propertyR t cascadet save_updatet add( R t statet itemt initiatort sesst prop( ( s= /usr/lib/python2.6/site-packages/sqlalchemy/orm/unitofwork.pyt append( s c C s} t | ƒ } | of t | ƒ i | i ƒ } | i i o= | | i j o- | i i t i | ƒ ƒ o | i | ƒ qy n d S( N( R R R R R t delete_orphant newt mappert _is_orphanR t instance_statet expunge( R R R R R R ( ( s= /usr/lib/python2.6/site-packages/sqlalchemy/orm/unitofwork.pyt remove1 s c C sÇ | | j o | St | ƒ } | ož t | ƒ i | i ƒ } | d j o+ | i i o | | j o | i | ƒ n | i i o= | | i j o- | i i t i | ƒ ƒ o | i | ƒ qà n | S( N( R R R R t NoneR R R R R R R R R R ( R R t newvaluet oldvalueR R R ( ( s= /usr/lib/python2.6/site-packages/sqlalchemy/orm/unitofwork.pyt set; s '( t __name__t __module__t __doc__R R R R ( ( ( s= /usr/lib/python2.6/site-packages/sqlalchemy/orm/unitofwork.pyR s t UOWTransactionc B s› e Z d Z d „ Z e d „ Z e e e d d „ Z d „ Z d „ Z e d „ Z d „ Z d „ Z d „ Z d „ Z e d „ ƒ Z d „ Z d „ Z RS( sg Handles the details of organizing and executing transaction tasks during a UnitOfWork object's flush() operation. The central operation is to form a graph of nodes represented by the ``UOWTask`` class, which is then traversed by a ``UOWExecutor`` object that issues SQL and instance-synchronizing operations via the related packages. c C sC | | _ | i | _ t ƒ | _ h | _ h | _ t ƒ | _ d S( N( t sessiont _mapper_flush_optst mapper_flush_optsR t dependenciest tasksR t processors( R R$ ( ( s= /usr/lib/python2.6/site-packages/sqlalchemy/orm/unitofwork.pyR T s c C sÎ d | | f } | | i j oU | i | \ } } | o7 | o/ t i | | d t ƒ} | | f | i |