Mike Bayer [Thu, 31 Jul 2008 16:41:41 +0000 (16:41 +0000)]
- Fixed bug whereby the "unsaved, pending instance"
FlushError raised for a pending orphan would not take
superclass mappers into account when generating
the list of relations responsible for the error.
Michael Trier [Wed, 23 Jul 2008 05:10:04 +0000 (05:10 +0000)]
Corrected problem with detecting closed connections. Fixed issues in reflecttable for reflecting the mssql tables. Removed unicode reflection test from mssql. Need to investigate this further.
Mike Bayer [Sun, 20 Jul 2008 18:23:44 +0000 (18:23 +0000)]
- An inheriting class can now override an attribute
inherited from the base class with a plain descriptor,
or exclude an inherited attribute via the
include_properties/exclude_properties collections.
Mike Bayer [Sat, 19 Jul 2008 19:23:37 +0000 (19:23 +0000)]
- Some improvements to the _CompileOnAttr mechanism which
should reduce the probability of "Attribute x was
not replaced during compile" warnings. (this generally
applies to SQLA hackers, like Elixir devs).
Mike Bayer [Sat, 19 Jul 2008 18:55:11 +0000 (18:55 +0000)]
- Class-bound attributes sent as arguments to
relation()'s remote_side and foreign_keys parameters
are now accepted, allowing them to be used with declarative.
Mike Bayer [Sat, 19 Jul 2008 18:18:50 +0000 (18:18 +0000)]
- reverted r4955, that was wrong. The backref responsible for the operation is the one where the "cascade" option should take effect.
- can use None as a value for cascade.
- documented cascade options in docstring, [ticket:1064]
Mike Bayer [Fri, 18 Jul 2008 22:11:22 +0000 (22:11 +0000)]
- save-update and delete-orphan cascade event handler
now considers the cascade rules of the event initiator only, not the local
attribute. This way the cascade of the initiator controls the behavior
regardless of backref events.
Mike Bayer [Fri, 18 Jul 2008 17:42:11 +0000 (17:42 +0000)]
- Fixed a series of potential race conditions in
Session whereby asynchronous GC could remove unmodified,
no longer referenced items from the session as they were
present in a list of items to be processed, typically
during session.expunge_all() and dependent methods.
Mike Bayer [Wed, 16 Jul 2008 21:56:23 +0000 (21:56 +0000)]
- MapperProperty gets its .key attribute assigned early, in _compile_property.
MapperProperty compilation is detected using a "_compiled" flag.
- A mapper which inherits from another, when inheriting
the columns of its inherited mapper, will use any
reassigned property names specified in that inheriting
mapper. Previously, if "Base" had reassigned "base_id"
to the name "id", "SubBase(Base)" would still get
an attribute called "base_id". This could be worked
around by explicitly stating the column in each
submapper as well but this is fairly unworkable
and also impossible when using declarative [ticket:1111].
Jason Kirtland [Wed, 16 Jul 2008 18:24:20 +0000 (18:24 +0000)]
- mysql.MSEnum value literals now automatically quoted when used in a CREATE.
The change is backward compatible. Slight expansion of patch from catlee.
Thanks! [ticket:1110]
Mike Bayer [Tue, 15 Jul 2008 14:54:37 +0000 (14:54 +0000)]
- Added a new SessionExtension hook called after_attach().
This is called at the point of attachment for objects
via add(), add_all(), delete(), and merge().
Mike Bayer [Mon, 14 Jul 2008 20:04:35 +0000 (20:04 +0000)]
- The "allow_column_override" flag from mapper() has
been removed. This flag is virtually always misunderstood.
Its specific functionality is available via the
include_properties/exclude_properties mapper arguments.
Mike Bayer [Mon, 14 Jul 2008 19:39:50 +0000 (19:39 +0000)]
possible fix for MS-SQL version of match() test, but the real solution here may be to have the correct default paramstyle set up on the MS-SQL dialect.
Mike Bayer [Wed, 9 Jul 2008 20:38:35 +0000 (20:38 +0000)]
- Declarative supports a __table_args__ class variable, which
is either a dictionary, or tuple of the form
(arg1, arg2, ..., {kwarg1:value, ...}) which contains positional
+ kw arguments to be passed to the Table constructor.
[ticket:1096]
Mike Bayer [Wed, 9 Jul 2008 16:15:14 +0000 (16:15 +0000)]
- SQLite Date, DateTime, and Time types only accept Python
datetime objects now, not strings. If you'd like to format
dates as strings yourself with SQLite, use a String type.
If you'd like them to return datetime objects anyway despite
their accepting strings as input, make a TypeDecorator around
String - SQLA doesn't encourage this pattern.
Mike Bayer [Sun, 6 Jul 2008 00:47:56 +0000 (00:47 +0000)]
- re-fixed the fix to the prefixes fix
- removed ancient descriptor() functions from dialects; replaced with Dialect.name
- removed similarly ancient sys.modules silliness in Engine.name
Mike Bayer [Sat, 5 Jul 2008 20:37:44 +0000 (20:37 +0000)]
- session.refresh() raises an informative error message if
the list of attributes does not include any column-based
attributes.
- query() raises an informative error message if no columns
or mappers are specified.
- lazy loaders now trigger autoflush before proceeding. This
allows expire() of a collection or scalar relation to
function properly in the context of autoflush.
Mike Bayer [Fri, 27 Jun 2008 20:12:11 +0000 (20:12 +0000)]
- Modified SQLite's representation of "microseconds" to
match the output of str(somedatetime), i.e. in that the
microseconds are represented as fractional seconds in
string format. [ticket:1090]
- implemented a __legacy_microseconds__ flag on DateTimeMixin which can
be used per-class or per-type instances to get the old behavior, for
compatibility with existing SQLite databases encoded by a previous
version of SQLAlchemy.
- will implement the reverse legacy behavior in 0.4.
Gaëtan de Menten [Wed, 25 Jun 2008 15:55:49 +0000 (15:55 +0000)]
`session.Query().iterate_instances()` has been renamed to just `instances()`. The old `instances()` method returning a list instead of an iterator no longer
exists. If you were relying on that behavior, you should use `list(your_query.instances())`.
Mike Bayer [Sat, 21 Jun 2008 17:23:14 +0000 (17:23 +0000)]
- implemented [ticket:887], refresh readonly props upon save
- moved up "eager_defaults" active refresh step (this is an option used by just one user pretty much)
to be per-instance instead of per-table
- fixed table defs from previous deferred attributes enhancement
- CompositeColumnLoader equality comparison fixed for a/b == None; I suspect the composite capability in SA
needs a lot more work than this
Mike Bayer [Tue, 17 Jun 2008 20:52:11 +0000 (20:52 +0000)]
- Added is_active flag to Sessions to detect when
a transaction is in progress [ticket:976]. This
flag is always True with a "transactional"
(in 0.5 a non-"autocommit") Session.