diff options
Diffstat (limited to 'lib/sqlalchemy/ext/assignmapper.py')
-rw-r--r-- | lib/sqlalchemy/ext/assignmapper.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/ext/assignmapper.py b/lib/sqlalchemy/ext/assignmapper.py index b8a676b75..07ba95a69 100644 --- a/lib/sqlalchemy/ext/assignmapper.py +++ b/lib/sqlalchemy/ext/assignmapper.py @@ -10,6 +10,9 @@ def monkeypatch_query_method(ctx, class_, name): 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) |