Mike Bayer [Wed, 19 Jul 2006 20:25:09 +0000 (20:25 +0000)]
mapper compilation work ongoing, someday it'll work....moved
around the initialization of MapperProperty objects to be after
all mappers are created to better handle circular compilations.
do_init() method is called on all properties now which are more
aware of their "inherited" status if so.
eager loads explicitly disallowed on self-referential relationships, or
relationships to an inheriting mapper (which is also self-referential)
Mike Bayer [Wed, 19 Jul 2006 16:10:15 +0000 (16:10 +0000)]
fix to typing in clause construction which specifically helps
type issues with polymorphic_union (CAST/ColumnClause propigates
its type to proxy columns)
Mike Bayer [Tue, 18 Jul 2006 17:09:08 +0000 (17:09 +0000)]
added "synonym()" function, applied to properties to have a
propname the same as another, for the purposes of overriding props
and allowing the original propname to be accessible in select_by().
Mike Bayer [Tue, 18 Jul 2006 15:14:55 +0000 (15:14 +0000)]
overhaul to MapperExtension so they arent chained via "next"; this breaks all over the place since extensions get copied between mappers etc. now theyre assembled into a list, of which a single extension can belong to many different lists.
Mike Bayer [Fri, 14 Jul 2006 20:06:09 +0000 (20:06 +0000)]
overhaul to schema, addition of ForeignKeyConstraint/
PrimaryKeyConstraint objects (also UniqueConstraint not
completed yet). table creation and reflection modified
to be more oriented towards these new table-level objects.
reflection for sqlite/postgres/mysql supports composite
foreign keys; oracle/mssql/firebird not converted yet.
Jonathan LaCour [Fri, 14 Jul 2006 14:54:53 +0000 (14:54 +0000)]
ActiveMapper now supports autoloading of column definitions if you supply
a __autoload__ = True attribute in your inner mapping class. It does not
currently support autoloading relationships.
Mike Bayer [Tue, 11 Jul 2006 00:36:32 +0000 (00:36 +0000)]
sqlite detects version and disables CAST if version < 3.2.3
fixes to unittests, mapper extension to work better with setting/unsetting extensions
objectstore objects get 'session' attribute
Mike Bayer [Mon, 10 Jul 2006 21:53:49 +0000 (21:53 +0000)]
activemapper will use threadlocal mod's objectstore if its installed
both objectstores no longer subclass SessionContext, get at it via .context attribute instead
Mike Bayer [Sun, 9 Jul 2006 19:48:02 +0000 (19:48 +0000)]
some refactorings to activemapper, made relationship() class have some polymorphic behavior for initializing its real relation, added support + unittest for self-referential relationship
Mike Bayer [Sun, 9 Jul 2006 17:58:01 +0000 (17:58 +0000)]
added workaround for funny pragma behavior on windows pysqlite
singletonthreadpool has a dispose() method, used by proxy_engine test
to better clean up after itself on windows
Mike Bayer [Sat, 8 Jul 2006 16:07:16 +0000 (16:07 +0000)]
took out that whole compilation dependency thing. just need to loop through mapper_registry and compile whatever is not compiled. the "non-reentrant" compile() method, which is a product of the whole compilation dependency tangent, makes this pretty easy. So it was a pretty roundabout way to go for ultimately a pretty small change to compilation.
Mike Bayer [Mon, 3 Jul 2006 15:55:20 +0000 (15:55 +0000)]
ordering of UPDATE and DELETE statements within groups is now
in order of primary key values, for more deterministic ordering
after_insert/delete/update mapper extensions now called per object,
not per-object-per-table
fixed import in firebird.py
Mike Bayer [Sat, 1 Jul 2006 19:26:30 +0000 (19:26 +0000)]
got MS-SQL support largely working, including reflection, basic types, fair amount of ORM stuff, etc.
'rowcount' label is reseved in MS-SQL and had to change in sql.py count() as well as orm.query
Mike Bayer [Fri, 30 Jun 2006 03:56:49 +0000 (03:56 +0000)]
fixes to attributes/related so that get_history with passive=True returns no
AttributeHistory object if an untriggered callable was found (not sure how this used to work
OK....)
Jonathan LaCour [Fri, 30 Jun 2006 01:19:52 +0000 (01:19 +0000)]
Put back in the foreign-key checking code in process_relationships for
ActiveMapper. It looks like it is required by at least one person, so for
now the code will stay in!
Jonathan LaCour [Thu, 29 Jun 2006 23:29:37 +0000 (23:29 +0000)]
There were two significant changes in this commit:
* Added implicit primary keys to ActiveMapper. Now, if you do not speicfy a
primary key on your objects when declaring them, an Integer primary key
called `id` will automatically be added to your objects for you.
* Commented out a large chunk of the process_relationships function that
should no longer be necessary thanks to some of the deferred mapper
compilation that was added in SQLAlchemy 0.2.3. I left it in the code, but
commented it out just in case this change causes a problem in someone's
else's code and I can put it back in if needed.
Mike Bayer [Tue, 27 Jun 2006 22:24:39 +0000 (22:24 +0000)]
new MySQL types: MSEnum, MSTinyText, MSMediumText, MSLongText, etc.
more support for MS-specific length/precision params in numeric types
patch courtesy Mike Bernson
Mike Bayer [Thu, 22 Jun 2006 20:03:09 +0000 (20:03 +0000)]
identified another TLTransaction scenario, and adjusted TLConnection/TLSession to fix this as well (reverted previous change, and overriding in_transaction() instead)
Mike Bayer [Thu, 22 Jun 2006 19:46:44 +0000 (19:46 +0000)]
TLConnection insures that it is used to create a transaction via the session when begin() is called, so that it has proper transactional context, + unittests
Mike Bayer [Mon, 19 Jun 2006 20:41:42 +0000 (20:41 +0000)]
when Query does the "nested select" thing, it copies the ORDER BY to be placed on the "outer" select, so that eager loaders modify only the outer one and not the inner one
Robert Leftwich [Sun, 18 Jun 2006 22:16:36 +0000 (22:16 +0000)]
Added some additional data to exception raised in PropertyLoader,_get_direction when cannot determine the direction to specify exactly which relation failed.
Mike Bayer [Sun, 18 Jun 2006 00:56:25 +0000 (00:56 +0000)]
lazy load and deferred load operations require the parent object
to be in a Session to do the operation; whereas before the operation
would just return a blank list or None, it now raises an exception.
Session.update() is slightly more lenient if the session to which
the given object was formerly attached to was garbage collected;
otherwise still requires you explicitly remove the instance from
the previous Session.
Mike Bayer [Sat, 17 Jun 2006 00:53:33 +0000 (00:53 +0000)]
cast converted into its own ClauseElement so that it can have an explicit compilation
function in ANSICompiler
MySQLCompiler then skips most CAST calls since it only seems to support the standard syntax for Date
types; other types now a TODO for MySQL
then, polymorphic_union() function now CASTs null()s to the type corresponding to the columns in the UNION,
since postgres doesnt like mixing NULL with integer types
(long road for that .....)
Mike Bayer [Fri, 16 Jun 2006 19:21:57 +0000 (19:21 +0000)]
more intelligent "removal" of list items when a list attribute is replaced, doesnt actually "remove" the items from teh replaced list just marks them as "removed" from the parent object for history purposes