From f5e12d0a05d897ff82f4f67545b6a1d238f6c46a Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 27 Mar 2011 21:13:17 -0400 Subject: [PATCH] - and fix the message that was the actual subject of [ticket:2063] --- lib/sqlalchemy/orm/dependency.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/sqlalchemy/orm/dependency.py b/lib/sqlalchemy/orm/dependency.py index 80c669c970..4695d4651d 100644 --- a/lib/sqlalchemy/orm/dependency.py +++ b/lib/sqlalchemy/orm/dependency.py @@ -260,9 +260,15 @@ class DependencyProcessor(object): }) else: raise exc.FlushError( - "Attempting to flush an item of type %s on collection '%s', " - "whose mapper does not inherit from that of %s." % - (state.class_, self.prop, self.mapper.class_)) + 'Attempting to flush an item of type ' + '%(x)s as a member of collection ' + '"%(y)s". Expected an object of type ' + '%(z)s or a polymorphic subclass of ' + 'this type.' % { + 'x': state.class_, + 'y': self.prop, + 'z': self.mapper.class_, + }) def _synchronize(self, state, child, associationrow, clearkeys, uowcommit): -- 2.47.3