The monkeypatch of flush() in assignmapper was broken because
Session.flush expects a list/tuple of objects. Attached patch makes the
monkey function pass in a single item list for flush instead.
-Sean Cazzell
Index: lib/sqlalchemy/ext/assignmapper.py
===================================================================
--- lib/sqlalchemy/ext/assignmapper.py (revision 1502)
+++ lib/sqlalchemy/ext/assignmapper.py (working copy)
@@ -10,6 +10,9 @@
def monkeypatch_objectstore_method(ctx, class_, name):
def do(self, *args, **kwargs):
session = ctx.current
+ if name == "flush":
+ # flush expects a list of objects
+ self = [self]
return getattr(session, name)(self, *args, **kwargs)
setattr(class_, name, do)