From 743ceb045e8be8b606198f4d5c02a72abebb2fbb Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 22 Jan 2014 20:16:47 -0500 Subject: - Support is improved for supplying a :func:`.join` construct as the target of :paramref:`.relationship.secondary` for the purposes of creating very complex :func:`.relationship` join conditions. The change includes adjustments to query joining, joined eager loading to not render a SELECT subquery, changes to lazy loading such that the "secondary" target is properly included in the SELECT, and changes to declarative to better support specification of a join() object with classes as targets. --- lib/sqlalchemy/ext/declarative/clsregistry.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/sqlalchemy/ext/declarative') diff --git a/lib/sqlalchemy/ext/declarative/clsregistry.py b/lib/sqlalchemy/ext/declarative/clsregistry.py index fda1cffb5..8b846746f 100644 --- a/lib/sqlalchemy/ext/declarative/clsregistry.py +++ b/lib/sqlalchemy/ext/declarative/clsregistry.py @@ -14,6 +14,7 @@ from ...orm.properties import ColumnProperty, RelationshipProperty, \ from ...schema import _get_table_key from ...orm import class_mapper, interfaces from ... import util +from ... import inspection from ... import exc import weakref @@ -207,6 +208,9 @@ class _GetColumns(object): " directly to a Column)." % key) return getattr(self.cls, key) +inspection._inspects(_GetColumns)( + lambda target: inspection.inspect(target.cls)) + class _GetTable(object): def __init__(self, key, metadata): -- cgit v1.2.1