summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sqlalchemy/orm/query.py7
-rw-r--r--lib/sqlalchemy/sql/selectable.py7
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index 9ac6d07da..2d97754f4 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -1963,9 +1963,10 @@ class Query(
q = session.query(Entity).order_by(Entity.id, Entity.name)
- All existing ORDER BY criteria may be cancelled by passing
- ``None`` by itself. New ORDER BY criteria may then be added by
- invoking :meth:`_orm.Query.order_by` again, e.g.::
+ Calling this method multiple times is equivalent to calling it once
+ with all the clauses concatenated. All existing ORDER BY criteria may
+ be cancelled by passing ``None`` by itself. New ORDER BY criteria may
+ then be added by invoking :meth:`_orm.Query.order_by` again, e.g.::
# will erase all ORDER BY and ORDER BY new_col alone
q = q.order_by(None).order_by(new_col)
diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py
index 488dfe721..23260a985 100644
--- a/lib/sqlalchemy/sql/selectable.py
+++ b/lib/sqlalchemy/sql/selectable.py
@@ -4096,9 +4096,10 @@ class GenerativeSelect(SelectBase, Generative):
stmt = select(table).order_by(table.c.id, table.c.name)
- All existing ORDER BY criteria may be cancelled by passing
- ``None`` by itself. New ORDER BY criteria may then be added by
- invoking :meth:`_sql.Select.order_by` again, e.g.::
+ Calling this method multiple times is equivalent to calling it once
+ with all the clauses concatenated. All existing ORDER BY criteria may
+ be cancelled by passing ``None`` by itself. New ORDER BY criteria may
+ then be added by invoking :meth:`_orm.Query.order_by` again, e.g.::
# will erase all ORDER BY and ORDER BY new_col alone
stmt = stmt.order_by(None).order_by(new_col)