From: Mike Bayer Date: Mon, 2 Jul 2012 17:56:28 +0000 (-0400) Subject: except the example was wrong. X-Git-Tag: rel_0_8_0b1~340 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6ff2d2969e74af4450fd87e38381e06b2dd6e5ae;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git except the example was wrong. --- diff --git a/doc/build/orm/session.rst b/doc/build/orm/session.rst index f6af22048d..4c376b47bb 100644 --- a/doc/build/orm/session.rst +++ b/doc/build/orm/session.rst @@ -1203,14 +1203,12 @@ which also works as a context manager. It can be succinctly used around individual record inserts in order to catch things like unique constraint exceptions:: - for i, record in enumerate(records): + for record in records: try: with session.begin_nested(): session.merge(record) except: print "Skipped record %s" % record - if not i % 1000: - session.flush() session.commit()