- changed status to resolved
Key updating after insert is triggering validations
Issue #3167
resolved
With MySQL backend, on commit after creating a new object with "autoincrement" PK, key updating is triggering validator. See https://bitbucket.org/zzzeek/sqlalchemy/src/2de7f94739ec1873e1dce48797e1e6f12044cf4c/lib/sqlalchemy/orm/persistence.py?at=master#cl-650
Documentation says only user assignments trigger validations, so this case shouldn't trigger validation.
Comments (4)
-
repo owner -
repo owner the fix here changes some internal behaviors quite a bit, not to mention who knows if an app sort of expects this behavior, so targeting this at 1.0.
-
repo owner well now we know,
#3427. -
repo owner Issue
#3439was marked as a duplicate of this issue. - Log in to comment
@validates
would have events triggered within the flush process, when those columns were the targets of a "fetch and populate" operation, such as an autoincremented primary key, a Python side default, or a server-side default "eagerly" fetched via RETURNING. fixes#3167→ <<cset 530d3f07e0c1>>