summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/query.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/orm/query.py')
-rw-r--r--lib/sqlalchemy/orm/query.py45
1 files changed, 23 insertions, 22 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index 458217e22..336b7d9aa 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -436,7 +436,7 @@ class Query(
reduce_columns=False,
_legacy_core_statement=False,
):
- """return the full SELECT statement represented by
+ """Return the full SELECT statement represented by
this :class:`_query.Query`, embedded within an
:class:`_expression.Alias`.
@@ -561,9 +561,9 @@ class Query(
Analogous to
:meth:`sqlalchemy.sql.expression.SelectBase.scalar_subquery`.
- .. versionchanged:: 1.4 the :meth:`_query.Query.scalar_subquery`
- method
- replaces the :meth:`_query.Query.as_scalar` method.
+ .. versionchanged:: 1.4 The :meth:`_query.Query.scalar_subquery`
+ method replaces the :meth:`_query.Query.as_scalar` method.
+
"""
return self.enable_eagerloads(False).statement.scalar_subquery()
@@ -645,8 +645,8 @@ class Query(
.. note:: The :meth:`_query.Query.with_labels` method *only* applies
the output of :attr:`_query.Query.statement`, and *not* to any of
- the result-row invoking systems of :class:`_query.Query` itself, e.
- g.
+ the result-row invoking systems of :class:`_query.Query` itself,
+ e.g.
:meth:`_query.Query.first`, :meth:`_query.Query.all`, etc.
To execute
a query using :meth:`_query.Query.with_labels`, invoke the
@@ -879,8 +879,8 @@ class Query(
the order in which they correspond to the mapped
:class:`_schema.Table`
object's primary key columns, or if the
- :paramref:`_orm.Mapper.primary_key` configuration parameter were used
- , in
+ :paramref:`_orm.Mapper.primary_key` configuration parameter were
+ used, in
the order used for that parameter. For example, if the primary key
of a row is represented by the integer
digits "5, 10" the call would look like::
@@ -1621,10 +1621,10 @@ class Query(
@_generative
def params(self, *args, **kwargs):
- r"""add values for bind parameters which may have been
+ r"""Add values for bind parameters which may have been
specified in filter().
- parameters may be specified using \**kwargs, or optionally a single
+ Parameters may be specified using \**kwargs, or optionally a single
dictionary as the first positional argument. The reason for both is
that \**kwargs is convenient, however some parameter dictionaries
contain unicode keys in which case \**kwargs cannot be used.
@@ -1643,7 +1643,7 @@ class Query(
@_generative
@_assertions(_no_statement_condition, _no_limit_offset)
def filter(self, *criterion):
- r"""apply the given filtering criterion to a copy
+ r"""Apply the given filtering criterion to a copy
of this :class:`_query.Query`, using SQL expressions.
e.g.::
@@ -1702,7 +1702,7 @@ class Query(
return self._raw_columns[0]
def filter_by(self, **kwargs):
- r"""apply the given filtering criterion to a copy
+ r"""Apply the given filtering criterion to a copy
of this :class:`_query.Query`, using keyword expressions.
e.g.::
@@ -1743,11 +1743,12 @@ class Query(
@_generative
@_assertions(_no_statement_condition, _no_limit_offset)
def order_by(self, *clauses):
- """apply one or more ORDER BY criterion to the query and return
- the newly resulting ``Query``
+ """Apply one or more ORDER BY criterion to the query and return
+ the newly resulting :class:`_query.Query`.
+
+ All existing ORDER BY settings can be suppressed by passing
+ ``None``.
- All existing ORDER BY settings candef order_by be suppressed by
- passing ``None``.
"""
if len(clauses) == 1 and (clauses[0] is None or clauses[0] is False):
@@ -1774,15 +1775,15 @@ class Query(
@_generative
@_assertions(_no_statement_condition, _no_limit_offset)
def group_by(self, *clauses):
- """apply one or more GROUP BY criterion to the query and return
- the newly resulting :class:`_query.Query`
+ """Apply one or more GROUP BY criterion to the query and return
+ the newly resulting :class:`_query.Query`.
All existing GROUP BY settings can be suppressed by
passing ``None`` - this will suppress any GROUP BY configured
on mappers as well.
- .. versionadded:: 1.1 GROUP BY can be cancelled by passing None,
- in the same way as ORDER BY.
+ .. versionadded:: 1.1 GROUP BY can be cancelled by passing
+ ``None``, in the same way as ORDER BY.
"""
@@ -1810,7 +1811,7 @@ class Query(
@_generative
@_assertions(_no_statement_condition, _no_limit_offset)
def having(self, criterion):
- r"""apply a HAVING criterion to the query and return the
+ r"""Apply a HAVING criterion to the query and return the
newly resulting :class:`_query.Query`.
:meth:`_query.Query.having` is used in conjunction with
@@ -1948,7 +1949,7 @@ class Query(
Where above, the call to :meth:`_query.Query.join` along
``User.addresses`` will result in SQL approximately equivalent to::
- SELECT user.id, User.name
+ SELECT user.id, user.name
FROM user JOIN address ON user.id = address.user_id
In the above example we refer to ``User.addresses`` as passed to