summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/dependency.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-03-27 21:14:06 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2011-03-27 21:14:06 -0400
commit90aa366fb3731892fd75455c81cdcc9e11268130 (patch)
tree9b0070cf60b920e898b291a30b821ca517ddadea /lib/sqlalchemy/orm/dependency.py
parent33691f6837970adfb6043094ab7e4ef63e44aceb (diff)
downloadsqlalchemy-90aa366fb3731892fd75455c81cdcc9e11268130.tar.gz
- and fix the message that was the actual subject of [ticket:2063]
Diffstat (limited to 'lib/sqlalchemy/orm/dependency.py')
-rw-r--r--lib/sqlalchemy/orm/dependency.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/dependency.py b/lib/sqlalchemy/orm/dependency.py
index 023b3e07e..44858fb85 100644
--- a/lib/sqlalchemy/orm/dependency.py
+++ b/lib/sqlalchemy/orm/dependency.py
@@ -268,9 +268,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):