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.
Mike Bayer [Mon, 9 Jun 2008 01:24:08 +0000 (01:24 +0000)]
- Query.UpdateDeleteTest.test_delete_fallback fails on mysql due to subquery in DELETE; not sure how to do this exact operation in MySQL
- added query_cls keyword argument to sessionmaker(); allows user-defined Query subclasses to be generated by query().
- added @attributes.on_reconstitute decorator, MapperExtension.on_reconstitute, both receieve 'on_load' attribute event allowing
non-__init__ dependent instance initialization routines.
- push memusage to the top to avoid pointless heisenbugs
- renamed '_foostate'/'_fooclass_manager' to '_sa_instance_state'/'_sa_class_manager'
- removed legacy instance ORM state accessors
- query._get() will use _remove_newly_deleted instead of expunge() on ObjectDeleted, so that transaction rollback
restores the previous state
- removed MapperExtension.get(); replaced by a user-defined Query subclass
- removed needless **kwargs from query.get()
- removed Session.get(cls, id); this is redundant against Session.query(cls).get(id)
- removed Query.load() and Session.load(); the use case for this method has never been clear, and the same functionality is available in more explicit ways
Mike Bayer [Mon, 2 Jun 2008 03:07:12 +0000 (03:07 +0000)]
- removed query.min()/max()/sum()/avg(). these should be called using column arguments or values in conjunction with func.
- fixed [ticket:1008], count() works with single table inheritance
- changed the relationship of InstrumentedAttribute to class such that each subclass in an inheritance hierarchy gets a unique InstrumentedAttribute per column-oriented attribute, including for the same underlying ColumnProperty. This allows expressions from subclasses to be annotated accurately so that Query can get a hold of the exact entities to be queried when using column-based expressions. This repairs various polymorphic scenarios with both single and joined table inheritance.
- still to be determined is what does something like query(Person.name, Engineer.engineer_info) do; currently it's problematic. Even trickier is query(Person.name, Engineer.engineer_info, Manager.manager_name)
Mike Bayer [Mon, 26 May 2008 23:01:05 +0000 (23:01 +0000)]
added string argument resolution to relation() in conjunction with declarative for: order_by,
primaryjoin, secondaryjoin, secondary, foreign_keys, and remote_side.
Mike Bayer [Sat, 24 May 2008 17:37:58 +0000 (17:37 +0000)]
- removed info about _local_remote_pairs from PropertyLoader.__determine_fks
- added order_by(), group_by(), having() to the list of "no offset()/limit()", [ticket:851]
Mike Bayer [Wed, 21 May 2008 21:40:58 +0000 (21:40 +0000)]
- globally renamed refresh_instance to refresh_state
- removed 'instance' arg from session.get_bind() and friends, this is not a public API
- renamed 'state' arg on same to '_state'
- fixes [ticket:1055]
Jason Kirtland [Wed, 21 May 2008 18:31:52 +0000 (18:31 +0000)]
- Fixed ORM orphaning bug with _raw_append method
- Promoted _reorder to reorder
- Now horking docstrings of overloaded methods from list
- Added a doctest
Jason Kirtland [Wed, 21 May 2008 03:39:06 +0000 (03:39 +0000)]
- Centralized 'x is not mapped' reporting into sa.orm.exc.
- Guards are now present on all public Session methods and passing in an
unmapped hoho anywhere yields helpful exception messages, going to some
effort to provide hints for debugging situations that would otherwise seem
hopeless, such as broken user instrumentation or half-pickles.