:released: Thu Sep 11 2008
.. change::
:tags: orm
:tickets:
Query now has delete() and update(values) methods. This allows
to perform bulk deletes/updates with the Query object.
.. change::
:tags: orm
:tickets:
The RowTuple object returned by Query(\*cols) now features
keynames which prefer mapped attribute names over column keys,
column keys over column names, i.e. Query(Class.foo,
Class.bar) will have names "foo" and "bar" even if those are
not the names of the underlying Column objects. Direct Column
objects such as Query(table.c.col) will return the "key"
attribute of the Column.
.. change::
:tags: orm
:tickets:
Added scalar() and value() methods to Query, each return a
single scalar value. scalar() takes no arguments and is
roughly equivalent to first()[0], value()
takes a single column expression and is roughly equivalent to
values(expr).next()[0].
.. change::
:tags: orm
:tickets:
Improved the determination of the FROM clause when placing SQL
expressions in the query() list of entities. In particular
scalar subqueries should not "leak" their inner FROM objects
out into the enclosing query.
.. change::
:tags: orm
:tickets:
Joins along a relation() from a mapped class to a mapped
subclass, where the mapped subclass is configured with single
table inheritance, will include an IN clause which limits the
subtypes of the joined class to those requested, within the ON
clause of the join. This takes effect for eager load joins as
well as query.join(). Note that in some scenarios the IN
clause will appear in the WHERE clause of the query as well
since this discrimination has multiple trigger points.
.. change::
:tags: orm
:tickets:
AttributeExtension has been refined such that the event
is fired before the mutation actually occurs. Additionally,
the append() and set() methods must now return the given value,
which is used as the value to be used in the mutation operation.
This allows creation of validating AttributeListeners which
raise before the action actually occurs, and which can change
the given value into something else before its used.
.. change::
:tags: orm
:tickets:
column_property(), composite_property(), and relation() now
accept a single or list of AttributeExtensions using the
"extension" keyword argument.
.. change::
:tags: orm
:tickets:
query.order_by().get() silently drops the "ORDER BY" from
the query issued by GET but does not raise an exception.
.. change::
:tags: orm
:tickets:
Added a Validator AttributeExtension, as well as a
validates decorator which is used in a similar fashion
as reconstructor, and marks a method as validating
one or more mapped attributes.
.. change::
:tags: orm
:tickets: 1140
class.someprop.in_() raises NotImplementedError pending the
implementation of "in\_" for relation
.. change::
:tags: orm
:tickets: 1127
Fixed primary key update for many-to-many collections where
the collection had not been loaded yet
.. change::
:tags: orm
:tickets:
Fixed bug whereby deferred() columns with a group in conjunction
with an otherwise unrelated synonym() would produce
an AttributeError during deferred load.
.. change::
:tags: orm
:tickets: 1128
The before_flush() hook on SessionExtension takes place before
the list of new/dirty/deleted is calculated for the final
time, allowing routines within before_flush() to further
change the state of the Session before the flush proceeds.
.. change::
:tags: orm
:tickets:
The "extension" argument to Session and others can now
optionally be a list, supporting events sent to multiple
SessionExtension instances. Session places SessionExtensions
in Session.extensions.
.. change::
:tags: orm
:tickets:
Reentrant calls to flush() raise an error. This also serves
as a rudimentary, but not foolproof, check against concurrent
calls to Session.flush().
.. change::
:tags: orm
:tickets:
Improved the behavior of query.join() when joining to
joined-table inheritance subclasses, using explicit join
criteria (i.e. not on a relation).
.. change::
:tags: orm
:tickets:
orm.attributes.reconstitute and
MapperExtension.reconstitute have been renamed to
orm.reconstructor and MapperExtension.reconstruct_instance
.. change::
:tags: orm
:tickets: 1129
Fixed reconstructor hook for subclasses which inherit from a
base class.
.. change::
:tags: orm
:tickets: 1132
The composite() property type now supports a
__set_composite_values__() method on the composite class which
is required if the class represents state using attribute
names other than the column's keynames; default-generated
values now get populated properly upon flush. Also,
composites with attributes set to None compare correctly.
.. change::
:tags: orm
:tickets:
The 3-tuple of iterables returned by attributes.get_history()
may now be a mix of lists and tuples. (Previously members
were always lists.)
.. change::
:tags: orm
:tickets: 1151
Fixed bug whereby changing a primary key attribute on an
entity where the attribute's previous value had been expired
would produce an error upon flush().
.. change::
:tags: orm
:tickets:
Fixed custom instrumentation bug whereby get_instance_dict()
was not called for newly constructed instances not loaded
by the ORM.
.. change::
:tags: orm
:tickets: 1150
Session.delete() adds the given object to the session if
not already present. This was a regression bug from 0.4.
.. change::
:tags: orm
:tickets:
The `echo_uow` flag on `Session` is deprecated, and unit-of-work
logging is now application-level only, not per-session level.
.. change::
:tags: orm
:tickets: 1153
Removed conflicting `contains()` operator from
`InstrumentedAttribute` which didn't accept `escape` kwaarg.
.. change::
:tags: declarative
:tickets: 1161
Fixed bug whereby mapper couldn't initialize if a composite
primary key referenced another table that was not defined
yet.
.. change::
:tags: declarative
:tickets:
Fixed exception throw which would occur when string-based
primaryjoin condition was used in conjunction with backref.
.. change::
:tags: schema
:tickets: 1033
Added "sorted_tables" accessor to MetaData, which returns
Table objects sorted in order of dependency as a list.
This deprecates the MetaData.table_iterator() method.
The "reverse=False" keyword argument has also been
removed from util.sort_tables(); use the Python
'reversed' function to reverse the results.
.. change::
:tags: schema
:tickets:
The 'length' argument to all Numeric types has been renamed
to 'scale'. 'length' is deprecated and is still accepted
with a warning.
.. change::
:tags: schema
:tickets:
Dropped 0.3-compatibility for user defined types
(convert_result_value, convert_bind_param).
.. change::
:tags: sql
:tickets: 1068
Temporarily rolled back the "ORDER BY" enhancement from. This feature is on hold pending further
development.
.. change::
:tags: sql
:tickets:
The exists() construct won't "export" its contained list
of elements as FROM clauses, allowing them to be used more
effectively in the columns clause of a SELECT.
.. change::
:tags: sql
:tickets: 798
and_() and or_() now generate a ColumnElement, allowing
boolean expressions as result columns, i.e.
select([and_(1, 0)]).
.. change::
:tags: sql
:tickets:
Bind params now subclass ColumnElement which allows them to be
selectable by orm.query (they already had most ColumnElement
semantics).
.. change::
:tags: sql
:tickets:
Added select_from() method to exists() construct, which becomes
more and more compatible with a regular select().
.. change::
:tags: sql
:tickets: 1160
Added func.min(), func.max(), func.sum() as "generic functions",
which basically allows for their return type to be determined
automatically. Helps with dates on SQLite, decimal types,
others.
.. change::
:tags: sql
:tickets:
added decimal.Decimal as an "auto-detect" type; bind parameters
and generic functions will set their type to Numeric when a
Decimal is used.
.. change::
:tags: mysql
:tickets:
The 'length' argument to MSInteger, MSBigInteger, MSTinyInteger,
MSSmallInteger and MSYear has been renamed to 'display_width'.
.. change::
:tags: mysql
:tickets: 1146
Added MSMediumInteger type.
.. change::
:tags: mysql
:tickets:
the function func.utc_timestamp() compiles to UTC_TIMESTAMP, without
the parenthesis, which seem to get in the way when using in
conjunction with executemany().
.. change::
:tags: oracle
:tickets: 536
limit/offset no longer uses ROW NUMBER OVER to limit rows,
and instead uses subqueries in conjunction with a special
Oracle optimization comment. Allows LIMIT/OFFSET to work
in conjunction with DISTINCT.
.. change::
:tags: oracle
:tickets: 1155
has_sequence() now takes the current "schema" argument into
account
.. change::
:tags: oracle
:tickets: 1121
added BFILE to reflected type names
.. changelog::