]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Added a code example for tuple_()
authorStepland <16676308+Stepland@users.noreply.github.com>
Mon, 16 Sep 2019 15:26:38 +0000 (17:26 +0200)
committerStepland <16676308+Stepland@users.noreply.github.com>
Mon, 16 Sep 2019 15:26:38 +0000 (17:26 +0200)
doc/build/orm/tutorial.rst

index 3e3ac0cd4a13b1f1d9636e900b0d08490da048c0..37c26ae807fcc73081b4b975c07be907aaed9ff5 100644 (file)
@@ -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_>`::