summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/pyodbc.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-01-25 11:51:04 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2017-03-16 17:16:49 -0400
commit9974e9a46bdf6c570c650aa911b76c2dcfd9327b (patch)
tree5631c6d247855cb8572d6c634987f23e6c068e0d /lib/sqlalchemy/dialects/mysql/pyodbc.py
parent63a7b2d2d9402b06f9bc7745eed2d98ae9f8b11c (diff)
downloadsqlalchemy-9974e9a46bdf6c570c650aa911b76c2dcfd9327b.tar.gz
Add bulk_replace event, integrate with @validates
Added new attribute event :meth:`.AttributeEvents.bulk_replace`. This event is triggered when a collection is assigned to a relationship, before the incoming collection is compared with the existing one. This early event allows for conversion of incoming non-ORM objects as well. The event is integrated with the ``@validates`` decorator. The ``@validates`` decorator now allows the decorated method to receive objects from a "bulk collection set" operation that have not yet been compared to the existing collection. This allows incoming values to be converted to compatible ORM objects as is already allowed from an "append" event. Note that this means that the ``@validates`` method is called for **all** values during a collection assignment, rather than just the ones that are new. Change-Id: I27f59db008d9e521d31a3e30143d7cd997e4b7b3 Fixes: #3896
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/pyodbc.py')
0 files changed, 0 insertions, 0 deletions