summaryrefslogtreecommitdiff
path: root/examples/pickle/custom_pickler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-07-27 04:08:53 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-07-27 04:08:53 +0000
commited4fc64bb0ac61c27bc4af32962fb129e74a36bf (patch)
treec1cf2fb7b1cafced82a8898e23d2a0bf5ced8526 /examples/pickle/custom_pickler.py
parent3a8e235af64e36b3b711df1f069d32359fe6c967 (diff)
downloadsqlalchemy-ed4fc64bb0ac61c27bc4af32962fb129e74a36bf.tar.gz
merging 0.4 branch to trunk. see CHANGES for details. 0.3 moves to maintenance branch in branches/rel_0_3.
Diffstat (limited to 'examples/pickle/custom_pickler.py')
-rw-r--r--examples/pickle/custom_pickler.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/pickle/custom_pickler.py b/examples/pickle/custom_pickler.py
index 4b259c1f8..b45e16e7c 100644
--- a/examples/pickle/custom_pickler.py
+++ b/examples/pickle/custom_pickler.py
@@ -6,7 +6,8 @@ from cStringIO import StringIO
from pickle import Pickler, Unpickler
import threading
-meta = MetaData('sqlite://', echo=True)
+meta = MetaData('sqlite://')
+meta.bind.echo = True
class MyExt(MapperExtension):
def populate_instance(self, mapper, selectcontext, row, instance, identitykey, isnew):
@@ -25,7 +26,7 @@ class MyPickler(object):
def persistent_id(self, obj):
if getattr(obj, "id", None) is None:
sess = MyPickler.sessions.current
- newsess = create_session(bind_to=sess.connection(class_mapper(Bar)))
+ newsess = create_session(bind=sess.connection(class_mapper(Bar)))
newsess.save(obj)
newsess.flush()
key = "%s:%s" % (type(obj).__name__, obj.id)