]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
set up is_from_statement and others for FromStatement
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 1 Apr 2024 21:54:22 +0000 (17:54 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 1 Apr 2024 23:29:06 +0000 (19:29 -0400)
commitd3222a31b8df97a454b37a32881dd484a06e5742
treef714cbd62bd2cea45caba3234493df928a297429
parentc3f8bd1c27fd5e376e88533542aa6fd669c58067
set up is_from_statement and others for FromStatement

Added new attribute :attr:`_orm.ORMExecuteState.is_from_statement`, to
detect statements of the form ``select().from_statement()``, and also
enhanced ``FromStatement`` to set :attr:`_orm.ORMExecuteState.is_select`,
:attr:`_orm.ORMExecuteState.is_insert`,
:attr:`_orm.ORMExecuteState.is_update`, and
:attr:`_orm.ORMExecuteState.is_delete` according to the element that is
sent to the :meth:`_sql.Select.from_statement` method itself.

Fixes: #11220
Change-Id: I3bf9e7e22fa2955d772b3b6ad636ed93a60916ae
doc/build/changelog/unreleased_20/11220.rst [new file with mode: 0644]
lib/sqlalchemy/orm/context.py
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/sql/base.py
test/orm/test_events.py