]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
- Replaced collection api: The "InstrumentedList" proxy is replaced with
authorJason Kirtland <jek@discorporate.us>
Wed, 27 Jun 2007 21:08:14 +0000 (21:08 +0000)
committerJason Kirtland <jek@discorporate.us>
Wed, 27 Jun 2007 21:08:14 +0000 (21:08 +0000)
commit7b87fcecd6652187fa789066c20b67a5154f44e1
tree7b9bfe4679faca3a10501bff545d7e325f8b4e77
parenta1a2fe74002bd3daeff10fc1d538837f2db650e9
- Replaced collection api: The "InstrumentedList" proxy is replaced with
  a proxy-free, decorator-based approach for user-space instrumentation and
  a "view" adapter for interaction with the user's collection within the orm.
  Fixes [ticket:213], [ticket:548], [ticket:563].
- This needs many more unit tests.  There is significant indirect coverage
  through association proxy, but direct tests are needed, specifically in
  the decorators and add/remove event firing.
- Collections are now instrumented via decorations rather than
  proxying.  You can now have collections that manage their own
  membership, and your class instance will be directly exposed on the
  relation property.  The changes are transparent for most users.
- InstrumentedList (as it was) is removed, and relation properties no
  longer have 'clear()', '.data', or any other added methods beyond those
  provided by the collection type.  You are free, of course, to add them
  to a custom class.
- __setitem__-like assignments now fire remove events for the existing
  value, if any.
- dict-likes used as collection classes no longer need to change __iter__
  semantics- itervalues() is used by default instead.  This is a backwards
  incompatible change.
- subclassing dict for a mapped collection is no longer needed in most cases.
  orm.collections provides canned implementations that key objects by a
  specified column or a custom function of your choice.
- collection assignment now requires a compatible type- assigning None
  to clear a collection or assinging a list to a dict collection will now
  raise an argument error.
- AttributeExtension moved to interfaces, and .delete is now .remove
  The event method signature has also been swapped around.
13 files changed:
CHANGES
lib/sqlalchemy/ext/associationproxy.py
lib/sqlalchemy/orm/attributes.py
lib/sqlalchemy/orm/collections.py [new file with mode: 0644]
lib/sqlalchemy/orm/interfaces.py
lib/sqlalchemy/orm/properties.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/orm/unitofwork.py
lib/sqlalchemy/util.py
test/ext/associationproxy.py
test/orm/attributes.py
test/orm/relationships.py
test/orm/unitofwork.py