Mike Bayer [Sat, 29 Apr 2006 01:05:13 +0000 (01:05 +0000)]
*another* big types change....the old way was still wrong...this way is better (still need to go through it again since i am apparently type-impaired....)
Jonathan LaCour [Sun, 23 Apr 2006 21:41:36 +0000 (21:41 +0000)]
Got the unit tests running again, apart from the two that were not working in
the first place. The changes to process_relationships and to sqlachemy itself
were causing a double 'assign_mapper' call to cause issues. Now, we basically
defer calling assign_mapper until process_relationships in cases where there
are defined relationships.
Also, I moved ActiveMapper to always use the default engine, as there were a
lot of hacks inside ActiveMapper to allow for engine swapping. The use of the
default engine and the "global_connect" functionality significantly improves
the usability of ActiveMapper.
ActiveMapper will be getting a bit of a refactor/cleanup at some point in the
nearish future, as it has drifted a bit to complexity with the addition of some
features. For now, this should do the trick!
Jonathan LaCour [Thu, 20 Apr 2006 21:04:03 +0000 (21:04 +0000)]
Updates to ActiveMapper contributed by Gabriel Jacobo. The main purpose of the
changes is to ensure that relationships are properly detected and built in the
proper order. This should fix some problems that people were having with
ActiveMapper requiring classes to be declared in a specific order.
Mike Bayer [Tue, 18 Apr 2006 18:24:07 +0000 (18:24 +0000)]
mapper will verify class inheritance scheme; also will not re-init inherited property, as the improved attribute system seems to handle inheritance OK and allows the property to keep its correct initialization on the parent
exceptions import in query
Mike Bayer [Fri, 14 Apr 2006 18:11:54 +0000 (18:11 +0000)]
had to take out the "treeification" of the dependency sort as it doenst really work , added test conditions to the dependency test + the original test that failed
Mike Bayer [Thu, 6 Apr 2006 23:46:02 +0000 (23:46 +0000)]
split up Session into Session/LegacySession, added some new constructor args
created AbstractEngine class which provides base for SQLEngine and will also
provide base for ConnectionProxy, so SQL binding can be to an engine or specific
connection resource
ClauseElements get using() method which can take AbstractEngines for execution
made more separation between SchemaItems and bound engine
Mike Bayer [Thu, 6 Apr 2006 21:12:00 +0000 (21:12 +0000)]
mapper's querying facilities migrated to new query.Query() object, which can receive session-specific context via the mapper.using() statement. reuslting object instances will be bound to this session, but query execution still handled by the SQLEngines implicit in the mapper's Table objects.
session now propigates to the unitofwork UOWTransaction object, as well as mapper's save_obj/delete_obj via the UOWTransaction it receives. UOWTransaction explicitly calls the Session for the engine corresponding to each Mapper in the flush operation, although the Session does not yet affect the choice of engines used, and mapper save/delete is still using the Table's implicit SQLEngine.
changed internal unitofwork commit() method to be called flush().
removed all references to 'engine' from mapper module, including adding insert/update specific SQLEngine methods such as last_inserted_ids, last_inserted_params, etc. to the returned ResultProxy so that Mapper need not know which SQLEngine was used for the execute.
changes to unit tests, SelectResults to support the new Query object.
Mike Bayer [Thu, 6 Apr 2006 19:01:14 +0000 (19:01 +0000)]
added explicit "session" argument to get(), select_whereclause in mapper, as well as throughout the call-chain for those. lazy loader honors the "session" of the parent object, + added simple unit test
Mike Bayer [Mon, 3 Apr 2006 21:43:22 +0000 (21:43 +0000)]
added 'entity_name' keyword argument to mapper. a mapper is now associated with a class via
the class object as well as the optional entity_name parameter, which is a string defaulting to None.
any number of primary mappers can be created for a class, qualified by the entity name. instances of those classes
will issue all of their load and save operations through their entity_name-qualified mapper, and maintain separate identity from an otherwise equilvalent object.
Mike Bayer [Mon, 3 Apr 2006 21:04:16 +0000 (21:04 +0000)]
attributes overhaul #2 - attribute manager now tracks class-level initializers strictly through the SmartPropery instances attached to the class, so that attributes retain their natural polymorphic behavior. naming conventions migrating to "managed_attribute", simplifying codepaths.
Mike Bayer [Mon, 3 Apr 2006 05:00:53 +0000 (05:00 +0000)]
made order_by/group_by construction a little more simplisitc
fix to mapper extension
CompoundSelect can export all columns now, not sure if theres any advantage there
Mike Bayer [Sat, 1 Apr 2006 21:00:41 +0000 (21:00 +0000)]
cleanup of attributes, better naming, added weak reference to base managed attribute to break circular refs, slightly shorter codepaths in some cases. added performance tester
Mike Bayer [Fri, 31 Mar 2006 23:43:20 +0000 (23:43 +0000)]
added unit test for the old commit that was in [changeset:1186]. modified its behavior a bit to not delete private relationships unless they were already marked as deleted at the attribute manipulation level. got "switching" behavior from one private relationship to another to work, added a unit test for that.