From 9cbf06570dc3454717a8ac26d1a0e8ea1acbc91f Mon Sep 17 00:00:00 2001 From: aplatkouski <5857672+aplatkouski@users.noreply.github.com> Date: Tue, 2 Jun 2020 23:03:17 +0300 Subject: [PATCH] Fix some broken links in the documentation Signed-off-by: aplatkouski <5857672+aplatkouski@users.noreply.github.com> --- lib/sqlalchemy/orm/query.py | 33 ++++++++++++++++---------------- lib/sqlalchemy/sql/selectable.py | 6 +++--- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index cdad55320c..dc208f7e16 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -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() @@ -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. @@ -1644,7 +1644,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.:: @@ -1703,7 +1703,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.:: @@ -1744,11 +1744,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): @@ -1775,15 +1776,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. """ @@ -1949,7 +1950,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 diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index 54f293967a..c032b2b7ed 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -371,9 +371,9 @@ class HasHints(object): :meth:`_expression.Select.with_hint` - :meth:.`.Select.prefix_with` - generic SELECT prefixing which also - can suit some database-specific HINT syntaxes such as MySQL - optimizer hints + :meth:`_expression.Select.prefix_with` - generic SELECT prefixing + which also can suit some database-specific HINT syntaxes such as + MySQL optimizer hints """ return self.with_hint(None, text, dialect_name) -- 2.47.3