]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Be less fiscal regarding validators functions
authorMiłosz Stypiński <mstypins@cisco.com>
Thu, 24 Jun 2021 16:21:30 +0000 (12:21 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 28 Jun 2021 15:34:00 +0000 (11:34 -0400)
commit5933a5dc2ec29248e1b8842245c8ddabd819c6dd
treea48a171f3c0a491655064719c3cb1fc3d38382fb
parentb02087666e4ff9199ea221fbee37be8438ecd7f0
Be less fiscal regarding validators functions

Adjusted the check in the mapper for a callable object that is used as a
``@validates`` validator function or a ``@reconstructor`` reconstruction
function, to check for "callable" more liberally such as to accommodate
objects based on fundamental attributes like ``__func__`` and
``__call___``, rather than testing for ``MethodType`` / ``FunctionType``,
allowing things like cython functions to work properly. Pull request
courtesy Miłosz Stypiński.

Fixes: #6538
Closes: #6539
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6539
Pull-request-sha: ed1d7fe5c9386bab0416ff32095afc777c26b6ca

Change-Id: I8350558bc9a9ba58f43e48e12ce25a0b30e4d767
doc/build/changelog/unreleased_14/6538.rst [new file with mode: 0644]
lib/sqlalchemy/orm/mapper.py
test/orm/test_mapper.py
test/orm/test_validators.py