summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/mapping/properties.py
Commit message (Collapse)AuthorAgeFilesLines
* merged 0.2 branch into trunk; 0.1 now in sqlalchemy/branches/rel_0_1Mike Bayer2006-05-251-980/+0
|
* commented out default schema name checkMike Bayer2006-04-261-1/+1
|
* removed a "swap" from the lazy binary clause. added a test for that ↵Mike Bayer2006-04-241-2/+2
| | | | condition....
* lazyload clause calculation uses anonymous keynames for the bind parameters, ↵Mike Bayer2006-04-241-5/+17
| | | | to avoid compilation name conflicts
* got circular many-to-many relationships to workMike Bayer2006-04-191-8/+6
|
* mapper's querying facilities migrated to new query.Query() object, which can ↵Mike Bayer2006-04-061-3/+3
| | | | | | | | | 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.
* added explicit "session" argument to get(), select_whereclause in mapper, as ↵Mike Bayer2006-04-061-12/+13
| | | | well as throughout the call-chain for those. lazy loader honors the "session" of the parent object, + added simple unit test
* added 'entity_name' keyword argument to mapper. a mapper is now associated ↵Mike Bayer2006-04-031-0/+2
| | | | | | | | 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.
* added unit test for the old commit that was in [changeset:1186]. modified ↵Mike Bayer2006-03-311-8/+8
| | | | 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.
* introducing...the mods package ! the SelectResults thing moves as the first modMike Bayer2006-03-311-4/+1
|
* Jonas Borgström's fantastic SelectRsults patch that adds dynamic list ↵Mike Bayer2006-03-311-1/+1
| | | | argument support to the mapper.select() methd. associated unit test tweaks and mapper integration.
* backrefs on cyclical relationships were breaking for the "root" node which ↵Mike Bayer2006-03-271-0/+3
| | | | had None for a parent, due to addition in [changeset:1186] which added a "deletion" traversal for many-to-one relationships. added unittest.
* removed circular loop in creating new list elements, fixes a common ↵Mike Bayer2006-03-251-0/+4
| | | | | | refresh() condition added None check in PropertyLoader many-to-one private deletion traversal, fixes byroot_tree (add a unit test for that)
* removed all "tablename + '_' + columname" code and replaced with ↵Mike Bayer2006-03-251-3/+3
| | | | | | | | column._label, to take advantage of column labeling rules bind param compilation,when it unique-ifys the name of bind params, maintains the length of the bind parameter name instead of appending to it
* some more tweaks to get more advanced polymorphic stuff to workMike Bayer2006-03-241-0/+3
|
* added some extra traversal for one-to-many/many-to-one "private" relations ↵Mike Bayer2006-03-221-9/+21
| | | | to allow single-object commits to cascade into private child objects
* removed printMike Bayer2006-03-221-1/+0
|
* fixed lazy clause construction to go off...you guessed it...the noninherited ↵Mike Bayer2006-03-211-1/+2
| | | | table !
* a few changes to attributes.py to allow faster initialization of object ↵Mike Bayer2006-03-211-2/+4
| | | | attributes on new objects
* a refactoring to the EagerLoaders' _instance method to do a bunch of column ↵Mike Bayer2006-03-211-6/+18
| | | | arithmetic up front, instead of on each row
* a few tweaks and the polymorph example can also use eager loadingMike Bayer2006-03-201-0/+8
|
* PropertyLoader will not re-determine direction when initialized a second ↵Mike Bayer2006-03-181-1/+5
| | | | time, as it is re-initialized as a copy made for an inheriting mapper, and no longer can get to the correct inheriting table.
* identified more issues with inheritance. mapper inheritance is more ↵Mike Bayer2006-03-171-4/+3
| | | | | | | closed-minded about how it creates the join crit erion as well as the sync rules in inheritance. syncrules have been tightened up to be smarter about creating a new SyncRule given lists of tables and a join clause. properties also checks for relation direction against the "noninherited table" which for the moment makes it a stronger requirement that a relation to a mapper must relate to that mapper's main table, not any tables that it inherits from.
* tweak to get_direction, rolls back a comparison of "foreigntable" to ↵Mike Bayer2006-03-131-2/+4
| | | | "parent"/"mapper" table to be more constrained. this change was originally in [changeset:1101] to help out the polymorph example but it now works without it. the change breaks the Post/Comment relationship in the ZBlog demo since the Post mapper has the comments table inside of it (also with no workaround).
* added 'noninherited table' prop to mapper indicating the "lead" table, in ↵Mike Bayer2006-03-091-8/+3
| | | | | | | | the case of inheritance. relations now create priamry/secondary joins against that lead table. if you want to create it against an inherited table, use explicit join conditions. added 'correlate' argument to CompoundSelect to get polymorph example working again.
* added check to relation that will see if the same table is included between ↵Mike Bayer2006-03-081-0/+5
| | | | the primaryjoin and secondaryjoin, and raises a descriptive exception if so.
* serious overhaul to get eager loads to work inline with an inheriting ↵Mike Bayer2006-03-081-6/+14
| | | | mapper, when the inheritance/eager loads share the same table. mapper inheritance will also favor the columns from the child table over those of the parent table when assigning column values to object attributes. "correlated subqueries" require a flag "correlated=True" if they are in the FROM clause of another SELECT statement, and they want to be correlated. this flag is set by default when using an "exists" clause.
* commentMike Bayer2006-03-071-3/+5
|
* backref() func will also honor lazy=True/FalseMike Bayer2006-03-071-1/+6
|
* added backref() function, allows the creation of a backref where you also ↵Mike Bayer2006-03-071-18/+33
| | | | send keyword arguments that will be placed on the relation
* fixed bug in eager loading on a many-to-one [ticket:96], added the ticket ↵Mike Bayer2006-03-061-0/+5
| | | | | | tests as a unit test eagerload2. got eagerload1 to be a unit test also.
* added new 'polymorphic' example. still trying to understand it :) .Mike Bayer2006-03-061-3/+4
| | | | | fixes to relation to enable it to locate "direction" more consistently with inheritance relationships more tweaks to parenthesizing subqueries, unions, etc.
* more work on cycles, fleshed out tests for post_update, fix to the delete ↵Mike Bayer2006-02-271-1/+1
| | | | | | phase of a one-to-many post update closes [ticket:67]
* implemented SyncRules for mapper with inheritance relationship, fixes ↵Mike Bayer2006-02-261-1/+3
| | | | | | [ticket:81] TableFinder becomes a list-implementing object (should probably create clauseutils or sqlutils for these little helper visitors)
* factored out "syncrule" logic to a separate package, so mapper will be able ↵Mike Bayer2006-02-261-109/+18
| | | | to make use of it as well as properties. also clarifies the "synchronization" idea
* adjustment to compile synchronizers which allows many-to-many synchronize to ↵Mike Bayer2006-02-261-2/+7
| | | | work even when one side of the relation has both tables in it (new unittest will be added to inheritance.py to show this...)
* more fix to one-to-one: 'unchanged_items' can be [None] also with one to one ↵Mike Bayer2006-02-221-2/+3
| | | | | | so check for this during delete
* fix to EagerLoad where it late-initializes its eager chain, thereby not ↵Mike Bayer2006-02-221-7/+18
| | | | getting messed up by late add_property() calls
* when creating lazy clause both sides of each clause must be ColumnMike Bayer2006-02-211-2/+2
|
* working on postupdate idea, refactoring to dependency processingMike Bayer2006-02-211-22/+23
|
* merged eager loading overhaul rev 1001:1009Mike Bayer2006-02-201-130/+87
| | | | | | | | | | | | | | | | | this includes: sql.Alias object keeps track of the immediate thing it aliased as well as the ultimate non-aliased (usually a Table) object, so that proxied columns can have a "parent" attribute some cleanup to SelectBaseMixin.order_by_clause to allow easier access, needs more cleanup engine has been making two ResultProxies all this time, added "return_raw" quickie flag to disable that some cleanup to _get_col_by_original so that it also works for oid columns, new eager load stuff more aggressively aliaseses orderby's so this was needed EagerLoader now makes "chains" of unique aliased eager loaders in all cases. no need for use_alias/selectalias anymore since it aliases every time. properly detects recursive eager loads and terminates them with a lazyloader, instead of raising an exception. totally simplified setup() and init() is more straightforward and has a single codepath now instead of two or three.
* some comments, changed SmartProperty to be smarter, UOWMike Bayer2006-02-191-0/+4
| | | | | version has "property" accessor which returns MapperProperty at the class level
* exception package added, support throughoutMike Bayer2006-02-191-14/+15
|
* Join object wasnt exporting foreign keys correctlyMike Bayer2006-02-161-8/+24
| | | | compile_synchronizers in PropertyLoader needed to take into account the full list of tables for each mapper when looking for synchronization rules, not just primary table
* commentrel_0_1_0Mike Bayer2006-02-141-2/+4
|
* the list-based foreign key doenst seem to work quite right, rolling it backMike Bayer2006-02-141-15/+10
|
* lazy load column fix courtesy raul garcia garciaMike Bayer2006-02-141-1/+1
|
* added 'post_update' attribute to PropertyLoader, means to defer processing ↵Mike Bayer2006-02-131-8/+24
| | | | of this property until after the object has been saved, and then to re-sync and force an update. used to break otherwise intra-row cycles. added for "many-to-one" so far.
* some tweaks to options, use_alias, live removedMike Bayer2006-02-121-3/+2
|
* cleanup and organization of code mostly in properties, making SyncRules clearer,Mike Bayer2006-02-121-120/+161
| | | | also "foreignkey" property can be a list, particularly for a self-referential table with a multi-column join condition