Changeset 340
- Timestamp:
- 06/17/08 17:36:07 (5 years ago)
- Files:
-
- 1 modified
-
elixir/trunk/elixir/ext/encrypted.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
elixir/trunk/elixir/ext/encrypted.py
r336 r340 48 48 49 49 50 try: 51 from sqlalchemy.orm import EXT_PASS 52 SA05orlater = False 53 except ImportError: 54 SA05orlater = True 55 50 56 # 51 57 # acts_as_encrypted statement … … 78 84 perform_encryption(instance) 79 85 return EXT_CONTINUE 80 86 87 if SA05orlater: 88 def on_reconstitute(self, mapper, instance): 89 perform_decryption(instance) 90 return True 91 EncryptedMapperExtension.on_reconstitute = on_reconstitute 92 else: 81 93 def populate_instance(self, mapper, selectcontext, row, instance, 82 94 *args, **kwargs): 83 #FIXME: this is not available anymore in 0.584 #<jek> Gedd: on_load will do what you want here.85 #the example in test/orm/instrumentation is the most succinct86 95 mapper.populate_instance(selectcontext, instance, row, 87 96 *args, **kwargs) 88 97 perform_decryption(instance) 89 98 return True 99 EncryptedMapperExtension.populate_instance = populate_instance 90 100 91 101 # make sure that the entity's mapper has our mapper extension
