From 20acf49e85f687573ea24375ac33aa2a958d9620 Mon Sep 17 00:00:00 2001 From: Stepland <16676308+Stepland@users.noreply.github.com> Date: Mon, 16 Sep 2019 17:26:38 +0200 Subject: [PATCH] Added a code example for tuple_() --- doc/build/orm/tutorial.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/build/orm/tutorial.rst b/doc/build/orm/tutorial.rst index 3e3ac0cd4a..37c26ae807 100644 --- a/doc/build/orm/tutorial.rst +++ b/doc/build/orm/tutorial.rst @@ -784,7 +784,15 @@ Here's a rundown of some of the most common operators used in )) .. note:: for composite (multi-column) IN queries, group columns together - using :func:`.tuple_` + using :func:`.tuple_` : + + .. sourcecode:: python + + from sqlalchemy import tuple_ + query.filter( + tuple_(User.name, User.nickname).\ + in_([('ed', 'edsnickname'), ('wendy', 'windy')]) + ) * :meth:`NOT IN <.ColumnOperators.notin_>`:: -- 2.47.3