From: Mike Bayer Date: Sat, 11 Feb 2006 15:43:52 +0000 (+0000) Subject: put assertion in to check for secondary table if secondaryjoin explicit X-Git-Tag: rel_0_1_0~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4358dd7551b68087c2d28661570f3647f13442df;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git put assertion in to check for secondary table if secondaryjoin explicit --- 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: