[Sqlalchemy-commits] commit/sqlalchemy: zzzeek: Add bulk_replace event, integrate with @validates
Brought to you by:
zzzeek
From: Bitbucket <com...@bi...> - 2017-03-16 21:23:54
|
1 new commit in sqlalchemy: https://bitbucket.org/zzzeek/sqlalchemy/commits/9974e9a46bdf/ Changeset: 9974e9a46bdf Branch: master User: zzzeek Date: 2017-03-16 21:16:49+00:00 Summary: 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 Affected #: 7 files Repository URL: https://bitbucket.org/zzzeek/sqlalchemy/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |