From de115ae40695d8e9fa6d85c629222bec2ea01ff6 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 17 Jul 2012 20:04:22 -0400 Subject: - a big renaming of all the _Underscore classes to have plain names. The old names are still defined for backwards compatibility. - _BindParamClause renamed to BindParameter --- lib/sqlalchemy/orm/mapper.py | 8 ++++---- lib/sqlalchemy/orm/properties.py | 4 ++-- lib/sqlalchemy/orm/query.py | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'lib/sqlalchemy/orm') diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 39591ef99..cd2fa62d5 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -141,7 +141,7 @@ class Mapper(_InspectionAttr): self._set_with_polymorphic(with_polymorphic) - if isinstance(self.local_table, expression._SelectBase): + if isinstance(self.local_table, expression.SelectBase): raise sa_exc.InvalidRequestError( "When mapping against a select() construct, map against " "an alias() of the construct instead." @@ -151,7 +151,7 @@ class Mapper(_InspectionAttr): if self.with_polymorphic and \ isinstance(self.with_polymorphic[1], - expression._SelectBase): + expression.SelectBase): self.with_polymorphic = (self.with_polymorphic[0], self.with_polymorphic[1].alias()) @@ -560,7 +560,7 @@ class Mapper(_InspectionAttr): else: self.with_polymorphic = None - if isinstance(self.local_table, expression._SelectBase): + if isinstance(self.local_table, expression.SelectBase): raise sa_exc.InvalidRequestError( "When mapping against a select() construct, map against " "an alias() of the construct instead." @@ -570,7 +570,7 @@ class Mapper(_InspectionAttr): if self.with_polymorphic and \ isinstance(self.with_polymorphic[1], - expression._SelectBase): + expression.SelectBase): self.with_polymorphic = (self.with_polymorphic[0], self.with_polymorphic[1].alias()) if self.configured: diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py index 044ba8e2c..dde0e2908 100644 --- a/lib/sqlalchemy/orm/properties.py +++ b/lib/sqlalchemy/orm/properties.py @@ -393,7 +393,7 @@ class RelationshipProperty(StrategizedProperty): or many-to-many context produce a NOT EXISTS clause. """ - if isinstance(other, (NoneType, expression._Null)): + if isinstance(other, (NoneType, expression.Null)): if self.property.direction in [ONETOMANY, MANYTOMANY]: return ~self._criterion_exists() else: @@ -691,7 +691,7 @@ class RelationshipProperty(StrategizedProperty): or many-to-many context produce an EXISTS clause. """ - if isinstance(other, (NoneType, expression._Null)): + if isinstance(other, (NoneType, expression.Null)): if self.property.direction == MANYTOONE: return sql.or_(*[x != None for x in self.property._calculated_foreign_keys]) diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 44f9ba7e5..35c70d51e 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -163,7 +163,7 @@ class Query(object): fa = [] for from_obj in obj: - if isinstance(from_obj, expression._SelectBase): + if isinstance(from_obj, expression.SelectBase): from_obj = from_obj.alias() fa.append(from_obj) @@ -460,7 +460,7 @@ class Query(object): .. versionadded:: 0.7.6 Parameters and usage are the same as those of the - :meth:`._SelectBase.cte` method; see that method for + :meth:`.SelectBase.cte` method; see that method for further details. Here is the `Postgresql WITH @@ -507,7 +507,7 @@ class Query(object): See also: - :meth:`._SelectBase.cte` + :meth:`.SelectBase.cte` """ return self.enable_eagerloads(False).\ @@ -518,7 +518,7 @@ class Query(object): :class:`.Query`, converted to a scalar subquery with a label of the given name. - Analogous to :meth:`sqlalchemy.sql._SelectBaseMixin.label`. + Analogous to :meth:`sqlalchemy.sql.SelectBaseMixin.label`. .. versionadded:: 0.6.5 @@ -531,7 +531,7 @@ class Query(object): """Return the full SELECT statement represented by this :class:`.Query`, converted to a scalar subquery. - Analogous to :meth:`sqlalchemy.sql._SelectBaseMixin.as_scalar`. + Analogous to :meth:`sqlalchemy.sql.SelectBaseMixin.as_scalar`. .. versionadded:: 0.6.5 @@ -2145,8 +2145,8 @@ class Query(object): statement = sql.text(statement) if not isinstance(statement, - (expression._TextClause, - expression._SelectBase)): + (expression.TextClause, + expression.SelectBase)): raise sa_exc.ArgumentError( "from_statement accepts text(), select(), " "and union() objects only.") @@ -3033,7 +3033,7 @@ class QueryContext(object): def __init__(self, query): if query._statement is not None: - if isinstance(query._statement, expression._SelectBase) and \ + if isinstance(query._statement, expression.SelectBase) and \ not query._statement.use_labels: self.statement = query._statement.apply_labels() else: -- cgit v1.2.1