]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
then spiff up that error msg
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 3 Apr 2012 15:24:16 +0000 (11:24 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 3 Apr 2012 15:24:16 +0000 (11:24 -0400)
lib/sqlalchemy/orm/relationships.py
test/orm/test_relationships.py

index c1503a79a6ee4e25af451761963bf58d94a50c40..1a6b8a6089dcda909b689f2040ac36a02894c175 100644 (file)
@@ -530,8 +530,13 @@ class JoinCondition(object):
     def _check_remote_side(self):
         if not self.local_remote_pairs:
             raise sa_exc.ArgumentError('Relationship %s could '
-                    'not determine any local/remote column '
-                    'pairs.'
+                    'not determine any unambiguous local/remote column '
+                    'pairs based on join condition and remote_side '
+                    'arguments.  '
+                    'Consider using the remote() annotation to '
+                    'accurately mark those elements of the join '
+                    'condition that are on the remote side of '
+                    'the relationship.'
                     % (self.prop, ))
 
     def _check_foreign_cols(self, join_condition, primary):
index b6f07e5f406c9ef1ccf0a52b12ffe146fe02520d..6e610b0cfb3a91c8a029a43f6d256c7cb99e0495 100644 (file)
@@ -120,7 +120,12 @@ class _RelationshipErrors(object):
         assert_raises_message(
             sa.exc.ArgumentError,
             "Relationship %s could not determine "
-            "any local/remote column pairs." % relname,
+            "any unambiguous local/remote column "
+            "pairs based on join condition and remote_side arguments.  "
+            r"Consider using the remote\(\) annotation to "
+            "accurately mark those elements of the join "
+            "condition that are on the remote side of the relationship." % relname,
+
             fn, *arg, **kw
         )