diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-04-01 18:18:12 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-04-01 18:18:12 -0400 |
commit | 4ffcc52c465c9e3b95f2b802099fb8a98fe98cb3 (patch) | |
tree | 370101cf3ee2e8f6c961106c37e5050ea8b655a5 /lib/sqlalchemy/ext/declarative.py | |
parent | acdeaf43f79e7f881e6a105bc3c5149266a3c580 (diff) | |
download | sqlalchemy-4ffcc52c465c9e3b95f2b802099fb8a98fe98cb3.tar.gz |
- move create_lazy_clause() to relationships
- add foreign, remote annotations to declarative
Diffstat (limited to 'lib/sqlalchemy/ext/declarative.py')
-rwxr-xr-x | lib/sqlalchemy/ext/declarative.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sqlalchemy/ext/declarative.py b/lib/sqlalchemy/ext/declarative.py index 891130a48..7e5ae03d9 100755 --- a/lib/sqlalchemy/ext/declarative.py +++ b/lib/sqlalchemy/ext/declarative.py @@ -1392,6 +1392,10 @@ class _GetTable(object): def _deferred_relationship(cls, prop): def resolve_arg(arg): import sqlalchemy + from sqlalchemy.orm import foreign, remote + + fallback = sqlalchemy.__dict__.copy() + fallback.update({'foreign':foreign, 'remote':remote}) def access_cls(key): if key in cls._decl_class_registry: @@ -1401,7 +1405,7 @@ def _deferred_relationship(cls, prop): elif key in cls.metadata._schemas: return _GetTable(key, cls.metadata) else: - return sqlalchemy.__dict__[key] + return fallback[key] d = util.PopulateDict(access_cls) def return_cls(): |