]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
put assertion in to check for secondary table if secondaryjoin explicit
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 11 Feb 2006 15:43:52 +0000 (15:43 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 11 Feb 2006 15:43:52 +0000 (15:43 +0000)
lib/sqlalchemy/mapping/properties.py

index 61bb3da36905385b1e2ee01d9a0422345a926d57..01c0921b7642fbe83bfdab62fd91452e03ef6c29 100644 (file)
@@ -164,6 +164,8 @@ class PropertyLoader(MapperProperty):
         self.key = key
         self.parent = parent
 
+        if self.secondaryjoin is not None and self.secondary is None:
+            raise ValueError("Property '" + self.key + "' specified with secondary join condition but no secondary argument")
         # if join conditions were not specified, figure them out based on foreign keys
         if self.secondary is not None:
             if self.secondaryjoin is None: