· This is a bugfix release which resolves many issues, some of which appeared in 0.8.0 as regressions and many more that affect all versions.
· New Relationship Features
· New Polymorphic Features - with_polymorphic() and of_type()
· New Runtime Inspection System
· Extensible Operator System
· HSTORE Support
· The 'objects' argument to flush() is no longer deprecated, as some valid use cases have been identified.
· Fixed identity_key() function which was not accepting a scalar argument for the identity.
· Fixed bug whereby populate_existing option would not propagate to subquery eager loaders.
· Adds some new features such as support for Common Table Expressions, and also has some important bug fixes.
· Tightened the iterate vs. remove mutex around the identity map iteration, attempting to reduce the chance of an (extremely rare) reentrant gc operation causing a deadlock. Might remove the mutex in 0.7.
· Added a `name` argument to `Query.subquery()`, to allow a fixed name to be assigned to the alias object.
· A warning is emitted when a joined-table inheriting mapper has no primary keys on the locally mapped table (but has pks on the superclass table).
· Fixed bug where "middle" class in a polymorphic hierarchy would have no 'polymorphic_on' column if it didn't also specify a 'polymorphic_identity', leading to strange errors upon refresh, wrong class loaded when querying from that target. Also emits the correct WHERE criterion when using single table inheritance.
· Fixed bug where a column with a SQL or server side default that was excluded from a mapping with include_properties or exclude_properties would result in UnmappedColumnError.
· Fixed bug in query.update() where 'evaluate' or 'fetch' expiration would fail if the column expression key was a class attribute with a different keyname as the actual column name.
· - Added an assertion during flush which ensures that no NULL-holding identity keys were generated on "newly persistent" objects. This can occur when user defined code inadvertently triggers flushes on not-fully-loaded objects.
· Lazy loads for relationship attributes now use the current state, not the "committed" state, of foreign and primary key attributes when issuing SQL, if a flush is not in process. Previously, only the database-committed state would be used. In particular, this would cause a many-to-one get()-on-lazyload operation to fail, as autoflush is not triggered on these loads when the attributes are determined and the "committed" state may not be available.
· A new flag on relationship(), load_on_pending, allows the lazy loader to fire off on pending objects without a flush taking place, as well as a transient object that's been manually "attached" to the session. Note that this flag blocks attribute events from taking place when an object is loaded, so backrefs aren't available until after a flush. The flag is only intended for very specific use cases.
· Another new flag on relationship(), cascade_backrefs, disables the "save-update" cascade when the event was initiated on the "reverse" side of a bidirectional relationship. This is a cleaner behavior so that many-to-ones can be set on a transient object without it getting sucked into the child object's session, while still allowing the forward collection to cascade. We *might* default this to False in 0.7.
· Slight improvement to the behavior of "passive_updates=False" when placed only on the many-to-one side of a relationship; documentation has been clarified that passive_updates=False should really be on the one-to-many side.
· Placing passive_deletes=True on a many-to-one emits a warning, since you probably intended to put it on the one-to-many side.
· Fixed bug that would prevent "subqueryload" from working correctly with single table inheritance for a relationship from a subclass - the "where type in (x, y, z)" only gets placed on the inside, instead of repeatedly.
· When using from_self() with single table inheritance, the "where type in (x, y, z)" is placed on the outside of the query only, instead of repeatedly. May make some more adjustments to this.
· scoped_session emits a warning when configure() is called if a Session is already present (checks only the current thread).
· The name ConcurrentModificationError has been changed to StaleDataError, and descriptive error messages have been revised to reflect exactly what the issue is. Both names will remain available for the forseeable future for schemes that may be specifying ConcurrentModificationError in an "except:" clause.
· Added a mutex to the identity map which mutexes remove operations against iteration methods, which now pre-buffer before returning an iterable. This because asyncrhonous gc can remove items via the gc thread at any time.
· The Session class is now present in sqlalchemy.orm.*. We're moving away from the usage of create_session(), which has non-standard defaults, for those situations where a one-step Session constructor is desired. Most users should stick with sessionmaker() for general use, however.
· query.with_parent() now accepts transient objects and will use the non-persistent values of their pk/fk attributes in order to formulate the criterion. Docs are also clarified as to the purpose of with_parent().
· The include_properties and exclude_properties arguments to mapper() now accept Column objects as members in addition to strings. This so that same-named Column objects, such as those within a join(), can be disambiguated.
· The C extension now also works with DBAPIs which use custom sequences as row (and not only tuples).
· Restored some bind-labeling logic from 0.5 which ensures that tables with column names that overlap another column of the form "<tablename>_<columnname>" won't produce errors if column.
· Table.create() and Table.drop() no longer apply metadata- level create/drop events.
· Postgresql now reflects sequence names associated with SERIAL columns correctly, after the name of of the sequence has been changed.
· Postgresql reflects the name of primary key constraints, if one exists.