From 4358dd7551b68087c2d28661570f3647f13442df Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 11 Feb 2006 15:43:52 +0000 Subject: [PATCH] put assertion in to check for secondary table if secondaryjoin explicit --- lib/sqlalchemy/mapping/properties.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/sqlalchemy/mapping/properties.py b/lib/sqlalchemy/mapping/properties.py index 61bb3da369..01c0921b76 100644 --- a/lib/sqlalchemy/mapping/properties.py +++ b/lib/sqlalchemy/mapping/properties.py @@ -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: -- 2.47.2