From: Stepland <16676308+Stepland@users.noreply.github.com> Date: Mon, 16 Sep 2019 15:35:45 +0000 (+0200) Subject: merge usage of tuple_() into the code example X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4861%2Fhead;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git merge usage of tuple_() into the code example --- diff --git a/doc/build/orm/tutorial.rst b/doc/build/orm/tutorial.rst index 37c26ae807..9842ece51f 100644 --- a/doc/build/orm/tutorial.rst +++ b/doc/build/orm/tutorial.rst @@ -783,16 +783,12 @@ Here's a rundown of some of the most common operators used in session.query(User.name).filter(User.name.like('%ed%')) )) - .. note:: for composite (multi-column) IN queries, group columns together - using :func:`.tuple_` : - - .. sourcecode:: python - - from sqlalchemy import tuple_ - query.filter( - tuple_(User.name, User.nickname).\ - in_([('ed', 'edsnickname'), ('wendy', 'windy')]) - ) + # use tuple_() for composite (multi-column) queries + from sqlalchemy import tuple_ + query.filter( + tuple_(User.name, User.nickname).\ + in_([('ed', 'edsnickname'), ('wendy', 'windy')]) + ) * :meth:`NOT IN <.ColumnOperators.notin_>`::