diff options
| author | Michael Williamson <mike@zwobble.org> | 2018-04-11 11:21:20 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-04-11 11:21:20 -0400 |
| commit | 6ca11d1b6a9f7743d684c83f2ecd29ea446e362f (patch) | |
| tree | febc1419d596ffd9403eeb4d57c5e5efadc34f7f | |
| parent | 036cdbe7fb2d651ba5fbbc758c8584df011c8043 (diff) | |
| download | sqlalchemy-6ca11d1b6a9f7743d684c83f2ecd29ea446e362f.tar.gz | |
Update argument name for distinct() to match docs
A tiny change so that the docs are more consistent. At the moment, the same argument is given two different names.
Change-Id: Ic487006887d048700f260b2ae4a05d9a380412c1
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/439
| -rw-r--r-- | lib/sqlalchemy/orm/query.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 043be5539..54be93055 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -2644,7 +2644,7 @@ class Query(object): self._offset = offset @_generative(_no_statement_condition) - def distinct(self, *criterion): + def distinct(self, *expr): r"""Apply a ``DISTINCT`` to the query and return the newly resulting ``Query``. @@ -2662,18 +2662,18 @@ class Query(object): :attr:`.Query.statement` accessor, however. :param \*expr: optional column expressions. When present, - the PostgreSQL dialect will render a ``DISTINCT ON (<expressions>>)`` + the PostgreSQL dialect will render a ``DISTINCT ON (<expressions>)`` construct. """ - if not criterion: + if not expr: self._distinct = True else: - criterion = self._adapt_col_list(criterion) + expr = self._adapt_col_list(expr) if isinstance(self._distinct, list): - self._distinct += criterion + self._distinct += expr else: - self._distinct = criterion + self._distinct = expr @_generative() def prefix_with(self, *prefixes): |
