summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/mapping/mapper.py
Commit message (Collapse)AuthorAgeFilesLines
* merged 0.2 branch into trunk; 0.1 now in sqlalchemy/branches/rel_0_1Mike Bayer2006-05-251-997/+0
|
* fixed a _get_criterion mismatch, cleaned up types + updated types docMike Bayer2006-05-051-0/+16
|
* save_obj/delete_obj need to specify column types to binds for primary key ↵Mike Bayer2006-05-041-4/+4
| | | | criterion
* "order_by" parameter propigated to inheriting mappersMike Bayer2006-05-031-0/+2
| | | | oracle ROW_NUMBER logic uses select.oid_column to get default order by
* added temporary option "construct_new" to mapper which will cause the mapper ↵Mike Bayer2006-04-231-1/+18
| | | | to use __new__ to create loaded instances instead of the __init__ method
* mapper will verify class inheritance scheme; also will not re-init inherited ↵Mike Bayer2006-04-181-1/+3
| | | | | | 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
* fix for [ticket:158] regarding translate rowMike Bayer2006-04-171-2/+2
|
* mapper's querying facilities migrated to new query.Query() object, which can ↵Mike Bayer2006-04-061-273/+97
| | | | | | | | | 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-26/+33
| | | | 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-42/+61
| | | | | | | | 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.
* made order_by/group_by construction a little more simplisitcMike Bayer2006-04-031-1/+1
| | | | | fix to mapper extension CompoundSelect can export all columns now, not sure if theres any advantage there
* adjustments...Mike Bayer2006-03-311-3/+4
|
* tweak...Mike Bayer2006-03-311-7/+7
|
* introducing...the mods package ! the SelectResults thing moves as the first modMike Bayer2006-03-311-16/+48
|
* starting to refactor mapper slightly, adding entity_name, version_id_col, ↵Mike Bayer2006-03-311-28/+23
| | | | allowing keywords in mapper.options()
* Jonas Borgström's fantastic SelectRsults patch that adds dynamic list ↵Mike Bayer2006-03-311-5/+6
| | | | argument support to the mapper.select() methd. associated unit test tweaks and mapper integration.
* tweak to mapper to allow inheritance on the same table.Mike Bayer2006-03-271-15/+17
|
* added always_refresh flag. when the mapper loads rows, it will pull objects ↵Mike Bayer2006-03-261-1/+5
| | | | from the identity map normally, but always blows away their attributes and replaces with those from the database, including changes
* rework to expire() to make it smarter. when you expire(), history is ↵Mike Bayer2006-03-261-4/+4
| | | | immediately removed as well as explicit from dirty/deleted lists. this also changes uow.rollback_object() to remove from those lists, which is strange that it didnt do that before. anyway the mapper, when selecting and creating instances, asks the uow if this already identity-mapped instance is expired, and if so refreshes it on the fly, saving the need for the re-_get() operation, if some other query happens to touch upon the expired object. unit test added to confirm this.
* column label generation checks for a conflict against a column named the ↵Mike Bayer2006-03-261-2/+2
| | | | | | same as the label comment in mapper
* improved translation of rows when proxying rows from one mapper to another.Mike Bayer2006-03-261-8/+16
|
* util: the __setitem__ method on historyarraylist was meaningless, surprising ↵Mike Bayer2006-03-261-4/+0
| | | | | | | | nobody noticed that. types: added PickleType, its slightly trickier than trivial, so OK now its standard. attributes: the level of pain if an AttributeError occurs inside a CallableProp, in combination with an object that implements __getattr__, is too deep for me to put the users through....so convert AttributeErrors to Assertions... engine: im not a fan of catching universal exceptions and squashing them
* removed all "tablename + '_' + columname" code and replaced with ↵Mike Bayer2006-03-251-2/+2
| | | | | | | | 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
* got some support for mapping to a select that only selects some of the ↵Mike Bayer2006-03-251-7/+25
| | | | columns of an underlying table
* some more tweaks to get more advanced polymorphic stuff to workMike Bayer2006-03-241-4/+32
|
* added "nest_on" option for Session, so nested transactions can occur mostly ↵Mike Bayer2006-03-221-0/+2
| | | | | | at the Session level, fixes [ticket:113]
* a few changes to attributes.py to allow faster initialization of object ↵Mike Bayer2006-03-211-0/+4
| | | | attributes on new objects
* identified more issues with inheritance. mapper inheritance is more ↵Mike Bayer2006-03-171-4/+18
| | | | | | | 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.
* Fix docstring and exception message in selectone_byAlexey Shamrin2006-03-131-2/+2
|
* added selectfirst_by/selectone_by, selectone throws exception if more than ↵Mike Bayer2006-03-131-17/+28
| | | | one row returned, courtesy J.Ellis
* refactor to Compiled.get_params() to return new ClauseParameters object, a ↵Mike Bayer2006-03-131-2/+2
| | | | | | | | | | | more intelligent bind parameter dictionary that does type conversions late and preserves the unconverted value; used to fix mappers not comparing correct value in post-fetch [ticket:110] removed pre_exec assertion from oracle/firebird regarding "check for sequence/primary key value" fix to Unicode type to check for null, fixes [ticket:109] create_engine() now uses genericized parameters; host/hostname, db/dbname/database, password/passwd, etc. for all engine connections fix to select([func(column)]) so that it creates a FROM clause to the column's table, fixes [ticket:111] doc updates for column defaults, indexes, connection pooling, engine params unit tests for the above bugfixes
* added 'noninherited table' prop to mapper indicating the "lead" table, in ↵Mike Bayer2006-03-091-0/+2
| | | | | | | | 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 identity() method to mapper, to help get the primary key of an instance.Mike Bayer2006-03-081-1/+7
|
* added check to relation that will see if the same table is included between ↵Mike Bayer2006-03-081-2/+6
| | | | 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-5/+18
| | | | 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.
* a mapper with inheritance will place itself as "dependent" on the inherited ↵Mike Bayer2006-03-061-3/+7
| | | | mapper; even though this is not usually needed, it allows certain exotic combinations of mapper setups to work (i.e. the one in the polymorph example)
* added new 'polymorphic' example. still trying to understand it :) .Mike Bayer2006-03-061-1/+0
| | | | | fixes to relation to enable it to locate "direction" more consistently with inheritance relationships more tweaks to parenthesizing subqueries, unions, etc.
* delete tables in an inheritance rel. requires them in reverseMike Bayer2006-03-061-1/+3
|
* got mapper to receive the onupdates after updating an instance (also ↵Mike Bayer2006-03-051-9/+22
| | | | properly receives defaults on inserts)...
* added objectstore.refresh(), including supporting changes in mapper, ↵Mike Bayer2006-03-021-24/+30
| | | | attributes, util
* took out that "TypeError" wrapper since it blows away stack traces and ↵Mike Bayer2006-02-281-5/+1
| | | | confuses users
* got mapper.using() to work, fixed push/pop mapper, custom session assignmentsMike Bayer2006-02-271-4/+27
|
* implemented SyncRules for mapper with inheritance relationship, fixes ↵Mike Bayer2006-02-261-7/+19
| | | | | | [ticket:81] TableFinder becomes a list-implementing object (should probably create clauseutils or sqlutils for these little helper visitors)
* place _instance_key on object only when objectstore finally register_clean's ↵Mike Bayer2006-02-261-3/+1
| | | | | | on it, to make room for more aggressive "identity map" assertion when modifying objects incoming from a result set
* merged sql_rearrangement branch , refactors sql package to work standalone withMike Bayer2006-02-251-3/+3
| | | | | clause elements including tables and columns, schema package deals with "physical" representations
* get() method needs to use the full table, not just the 'primary' table, to ↵Mike Bayer2006-02-241-1/+1
| | | | get the full list of primary key cols
* moved iteration of props so that props can set up self-referring backref ↵Mike Bayer2006-02-221-1/+2
| | | | properties without getting a "list changed during iteration" error
* working on postupdate idea, refactoring to dependency processingMike Bayer2006-02-211-0/+16
|
* some comments, changed SmartProperty to be smarter, UOWMike Bayer2006-02-191-0/+5
| | | | | version has "property" accessor which returns MapperProperty at the class level
* exception package added, support throughoutMike Bayer2006-02-191-11/+12
|