]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add public accessor `is_single_entity` to Query
authorPatrick Hayes <pfhayes@gmail.com>
Thu, 24 Oct 2019 14:11:52 +0000 (10:11 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 27 Oct 2019 16:27:23 +0000 (12:27 -0400)
commit5f38875bb4c3f9cafa86c87f83219e32e45f5791
treeee6985a730bf91fccebbabbaf239cd02e4b2d1cd
parentc92f166792a8119bd9243aa8a2fd2038413996f4
Add public accessor `is_single_entity` to Query

Added accessor :attr:`.Query.is_single_entity` to :class:`.Query`, which
will indicate if the results returned by this :class:`.Query` will be a
list of ORM entities, or a tuple of entities or column expressions.
SQLAlchemy hopes to improve upon the behavior of single entity / tuples in
future releases such that the behavior would be explicit up front, however
this attribute should be helpful with the current behavior.  Pull request
courtesy Patrick Hayes.

Fixes: #4934
Closes: #4935
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4935
Pull-request-sha: 98f72b40a896761a65b048cc3722ff2dac4cf2b1

Change-Id: If5db5db3ea46a93406d76ef90b5b588149ba2986
(cherry picked from commit e55e749e182e257fcc60db383751d5afbe52ddfb)
doc/build/changelog/unreleased_13/4934.rst [new file with mode: 0644]
lib/sqlalchemy/orm/loading.py
lib/sqlalchemy/orm/query.py
test/orm/test_query.py