Changeset 391

Show
Ignore:
Timestamp:
08/18/08 18:32:48 (4 years ago)
Author:
ged
Message:

follow SA on the rename of on_reconstitute to reconstructor in SA0.5 trunk

Location:
elixir/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • elixir/trunk/elixir/events.py

    r352 r391  
    66    'before_delete', 
    77    'after_delete', 
    8     'on_reconstitute' 
     8    'reconstructor' 
    99] 
    1010 
     
    2424after_delete = create_decorator('after_delete') 
    2525try: 
    26     from sqlalchemy.orm.attributes import on_reconstitute 
     26    from sqlalchemy.orm import reconstructor 
    2727except ImportError: 
    28     def on_reconstitute(func): 
    29         raise Exception('The on_reconstitute method decorator is only ' 
     28    def reconstructor(func): 
     29        raise Exception('The reconstructor method decorator is only ' 
    3030                        'available with SQLAlchemy 0.5 and later') 
  • elixir/trunk/tests/test_events.py

    r364 r391  
    55 
    66stateDict = dict( 
    7     on_reconstitute_called = 0, 
     7    reconstructor_called = 0, 
    88    before_insert_called = 0, 
    99    after_insert_called = 0, 
     
    1212    before_delete_called = 0, 
    1313    after_delete_called = 0, 
    14     before_any_called = 0, 
     14    before_any_called = 0 
    1515) 
    1616 
     
    3434        try: 
    3535            def post_fetch(self): 
    36                 record_event('on_reconstitute_called') 
    37             post_fetch = on_reconstitute(post_fetch) 
     36                record_event('reconstructor_called') 
     37            post_fetch = reconstructor(post_fetch) 
    3838        except: 
    3939            pass 
     
    9797 
    9898        def checkCount(name, value): 
     99            print name, value 
    99100            dictCount = stateDict[name] 
    100101            assert dictCount == value, \ 
     
    116117        checkCount('before_any_called', 3) 
    117118 
    118         on_rec_available = False 
     119        reconstructor_available = False 
    119120        try: 
    120             on_reconstitute(lambda:0) 
    121             on_rec_available = True 
     121            reconstructor(lambda: 0) 
     122            reconstructor_available = True 
    122123        except: 
    123124            pass 
    124125 
    125         if on_rec_available: 
    126             checkCount('on_reconstitute_called', 2) 
     126        if reconstructor_available: 
     127            checkCount('reconstructor_called', 2) 
    127128 
    128129if __name__ == '__main__':