From: Stepland <16676308+Stepland@users.noreply.github.com> Date: Mon, 16 Sep 2019 15:26:38 +0000 (+0200) Subject: Added a code example for tuple_() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20acf49e85f687573ea24375ac33aa2a958d9620;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Added a code example for tuple_() --- 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_>`::