diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-01-27 01:05:20 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-01-27 01:05:20 +0000 |
commit | 7e7aa8f7c28628c4b5de7428c33ed63552e8f5b9 (patch) | |
tree | 8e3a9f3cd2449100e88e76f51ef30fa1c85c76e3 /lib/sqlalchemy/ext/sqlsoup.py | |
parent | 332be8c3962f57206680b79f064b1995884a5a2d (diff) | |
download | sqlalchemy-7e7aa8f7c28628c4b5de7428c33ed63552e8f5b9.tar.gz |
- Query now implements __clause_element__() which produces
its selectable, which means a Query instance can be accepted
in many SQL expressions, including col.in_(query),
union(query1, query2), select([foo]).select_from(query),
etc.
- the __selectable__() interface has been replaced entirely
by __clause_element__().
Diffstat (limited to 'lib/sqlalchemy/ext/sqlsoup.py')
-rw-r--r-- | lib/sqlalchemy/ext/sqlsoup.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/ext/sqlsoup.py b/lib/sqlalchemy/ext/sqlsoup.py index 37b9d8fa8..f2754793b 100644 --- a/lib/sqlalchemy/ext/sqlsoup.py +++ b/lib/sqlalchemy/ext/sqlsoup.py @@ -397,7 +397,7 @@ class SelectableClassType(type): def update(cls, whereclause=None, values=None, **kwargs): _ddl_error(cls) - def __selectable__(cls): + def __clause_element__(cls): return cls._table def __getattr__(cls, attr): @@ -442,7 +442,7 @@ def _selectable_name(selectable): return x def class_for_table(selectable, **mapper_kwargs): - selectable = expression._selectable(selectable) + selectable = expression._clause_element_as_expr(selectable) mapname = 'Mapped' + _selectable_name(selectable) if isinstance(mapname, unicode): engine_encoding = selectable.metadata.bind.dialect.encoding @@ -531,7 +531,7 @@ class SqlSoup: def with_labels(self, item): # TODO give meaningful aliases - return self.map(expression._selectable(item).select(use_labels=True).alias('foo')) + return self.map(expression._clause_element_as_expr(item).select(use_labels=True).alias('foo')) def join(self, *args, **kwargs): j = join(*args, **kwargs) |