Mike Bayer [Wed, 19 Mar 2008 19:35:42 +0000 (19:35 +0000)]
- like() and ilike() take an optional keyword argument
"escape=<somestring>", which is set as the escape character
using the syntax "x LIKE y ESCAPE '<somestring>'"
[ticket:993]
Mike Bayer [Tue, 18 Mar 2008 20:59:52 +0000 (20:59 +0000)]
- fixed/added coverage for various cascade scenarios
- added coverage for some extra cases in dynamic relations
- removed some unused methods from unitofwork
Mike Bayer [Tue, 18 Mar 2008 17:42:07 +0000 (17:42 +0000)]
- added support for declarative deferred(Column(...))
- changed "instrument" argument on synonym() to "descriptor", for consistency with comparable_proeprty()
Jason Kirtland [Mon, 17 Mar 2008 22:06:49 +0000 (22:06 +0000)]
- Added comparable_property(), adds query Comparator behavior to regular, unmanaged Python properties
- Some aspects of MapperProperty initialization are streteched pretty thin now
and need a refactor; will proceed with these on the user_defined_state branch
Mike Bayer [Sun, 16 Mar 2008 23:49:55 +0000 (23:49 +0000)]
- fixed "cascade delete" operation of dynamic relations,
which had only been implemented for foreign-key nulling
behavior in 0.4.2 and not actual cascading deletes
[ticket:895]
Mike Bayer [Sat, 15 Mar 2008 20:18:54 +0000 (20:18 +0000)]
- the "synonym" function is now directly usable with
"declarative". Pass in the decorated property using
the "instrument" keyword argument, e.g.:
somekey = synonym('_somekey', instrument=property(g, s))
- declared_synonym deprecated
Mike Bayer [Mon, 10 Mar 2008 17:14:08 +0000 (17:14 +0000)]
- a new super-small "declarative" extension has been added,
which allows Table and mapper() configuration to take place
inline underneath a class declaration. This extension differs
from ActiveMapper and Elixir in that it does not redefine
any SQLAlchemy semantics at all; literal Column, Table
and relation() constructs are used to define the class
behavior and table definition.
Mike Bayer [Mon, 10 Mar 2008 00:59:51 +0000 (00:59 +0000)]
- relation() can accept a callable for its first argument,
which returns the class to be related. This is in place
to assist declarative packages to define relations without
classes yet being in place.
Mike Bayer [Fri, 7 Mar 2008 03:16:46 +0000 (03:16 +0000)]
- moved property._is_self_referential() to be more generalized; returns True for any mapper.isa() relationship between parent and child, and indicates that aliasing should be used for any join/correlation across the relation. allows joins/any()/has() to work with inherited mappers referencing the parent etc.
- the original _is_self_referential() is now _refers_to_parent_table() and is only used during "direction" calculation to indicate the relation is from a single table to itself
Mike Bayer [Thu, 6 Mar 2008 18:44:45 +0000 (18:44 +0000)]
- added assert_raises() to TestBase class
- session.refresh() and session.expire() raise an error when
called on instances which are not persistent within the session
- session._validate_persistent() properly raises an error for false check
Mike Bayer [Thu, 6 Mar 2008 16:53:40 +0000 (16:53 +0000)]
- adjusted generative.py test for revised error message
- mapper with non_primary asserts primary mapper already created
- added any()/instance compare test to query
Mike Bayer [Tue, 4 Mar 2008 19:31:33 +0000 (19:31 +0000)]
- postgres PGArray is a "mutable" type by default;
when used with the ORM, mutable-style equality/
copy-on-write techniques are used to test for changes.
Mike Bayer [Sat, 1 Mar 2008 22:30:02 +0000 (22:30 +0000)]
- state.commit() and state.commit_all() now reconcile the current dict against expired_attributes
and unset the expired flag for those attributes. This is partially so that attributes are not
needlessly marked as expired after a two-phase inheritance load.
- fixed bug which was introduced in 0.4.3, whereby loading an
already-persistent instance mapped with joined table inheritance
would trigger a useless "secondary" load from its joined
table, when using the default "select" polymorphic_fetch.
This was due to attributes being marked as expired
during its first load and not getting unmarked from the
previous "secondary" load. Attributes are now unexpired
based on presence in __dict__ after any load or commit
operation succeeds.
Mike Bayer [Sat, 1 Mar 2008 01:46:23 +0000 (01:46 +0000)]
- fixed bug whereby session.expire() attributes were not
loading on an polymorphically-mapped instance mapped
by a select_table mapper.
- added query.with_polymorphic() - specifies a list
of classes which descend from the base class, which will
be added to the FROM clause of the query. Allows subclasses
to be used within filter() criterion as well as eagerly loads
the attributes of those subclasses.
Mike Bayer [Fri, 29 Feb 2008 21:54:40 +0000 (21:54 +0000)]
- setting the relation()-level order by to a column in the
many-to-many "secondary" table will now work with eager
loading, previously the "order by" wasn't aliased against
the secondary table's alias.
Mike Bayer [Mon, 25 Feb 2008 18:32:11 +0000 (18:32 +0000)]
- added exception wrapping/reconnect support to result set
fetching. Reconnect works for those databases that
raise a catchable data error during results
(i.e. doesn't work on MySQL) [ticket:978]
Mike Bayer [Fri, 22 Feb 2008 23:17:15 +0000 (23:17 +0000)]
- the value of a bindparam() can be a callable, in which
case it's evaluated at statement execution time to
get the value.
- expressions used in filter(), filter_by() and others,
when they make usage of a clause generated from a
relation using the identity of a child object
(e.g. filter(Parent.child==<somechild>)), evaluate
the actual primary key value of <somechild> at
execution time so that the autoflush step of the
Query can complete, thereby populating the PK value
of <somechild> in the case that <somechild> was
pending.
- cleanup of attributes.get_committed_value() to never return
the NO_VALUE value; evaluates to None