summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm
Commit message (Collapse)AuthorAgeFilesLines
* - Added active_history flag to relationship()Mike Bayer2010-11-184-4/+34
| | | | | | | and column_property(), forces attribute events to always load the "old" value, so that it's available to attributes.get_history(). [ticket:1961] - modernize test_relationship, give test classes meaningful names
* - The mapper argument "primary_key" can be passed as aMike Bayer2010-11-181-1/+1
| | | | single column as well as a list or tuple. [ticket:1971]
* - primary_key arg to mapper() is a listMike Bayer2010-11-161-22/+23
| | | | - other modernizations to mapper() doc
* - Fixed indexing of Query objects by -1. It was erroneouslyMike Bayer2010-11-151-1/+4
| | | | | transformed to the empty slice -1:0 that resulted in IndexError. [ticket:1968]
* - move inline "import" statements to use new "util.importlater()" construct. ↵Mike Bayer2010-11-136-58/+35
| | | | | | | | | cuts down on clutter, timeit says there's a teeny performance gain, at least where the access is compared against attr.subattr. these aren't super-critical calls anyway - slight inlining in _class_to_mapper
* - additional fix for [ticket:1964]Mike Bayer2010-11-131-1/+1
| | | | - [ticket:1965] is invalid
* - Fixed bug regarding "subqueryload" strategy wherebyMike Bayer2010-11-111-2/+4
| | | | | strategy would fail if the entity was an aliased() construct. [ticket:1964]
* - "innerjoin" flag doesn't take effect along the chainMike Bayer2010-11-051-7/+14
| | | | | | | of joinedload() joins if a previous join in that chain is an outer join, thus allowing primary rows without a referenced child row to be correctly returned in results. [ticket:1954]
* - write a new section describing the "subtransactions=True" flag in full detailMike Bayer2010-11-011-17/+8
|
* - Fixed bug whereby a non-"mutable" attribute modified eventMike Bayer2010-10-261-2/+8
| | | | | | | | | which occurred on an object that was clean except for preceding mutable attribute changes would fail to strongly reference itself in the identity map. This would cause the object to be garbage collected, losing track of any changes that weren't previously saved in the "mutable changes" dictionary.
* - make a futile attempt to combat the needless usage of clear_mappers() in ↵Mike Bayer2010-10-231-5/+18
| | | | | | the wild, [ticket:1861]
* fix typoMike Bayer2010-10-231-1/+1
|
* - New Query methods: query.label(name), query.as_scalar(),Mike Bayer2010-10-231-2/+57
| | | | | | | | | | return the query's statement as a scalar subquery with /without label [ticket:1920]; query.with_entities(*ent), replaces the SELECT list of the query with new entities. Roughly equivalent to a generative form of query.values() which accepts mapped entities as well as column expressions.
* - document is_modified() caveats including that the "old" value isn't alwaysMike Bayer2010-10-201-6/+26
| | | | | present, and that this results in a positive response for "changed" [ticket:1928]
* note expire_on_commit in the docstring for commit() as wellMike Bayer2010-10-161-1/+8
|
* - Added a new "lazyload" option "immediateload".Mike Bayer2010-10-156-58/+71
| | | | | | | | | | Issues the usual "lazy" load operation automatically as the object is populated. The use case here is when loading objects to be placed in an offline cache, or otherwise used after the session isn't available, and straight 'select' loading, not 'joined' or 'subquery', is desired. [ticket:1914]
* - Fixed labeling bug in Query whereby the NamedTupleMike Bayer2010-10-141-4/+2
| | | | | would mis-apply labels if any of the column expressions were un-labeled.
* - Fixed bug in query.update() where 'evaluate' or 'fetch'Mike Bayer2010-10-012-3/+9
| | | | | | expiration would fail if the column expression key was a class attribute with a different keyname as the actual column name. [ticket:1935]
* - add additional logic that duplicates mapper's prop.copy(); ↵Mike Bayer2010-10-011-1/+3
| | | | | | | | | prop.columns.append(col) logic when columns are present in a joined subclass with an attribute name different than the column name itself [ticket:1931] - add coverage to verify that we need to check (obj.name or name) when deciding if a Column from a mixin should be added to the mapped table
* - reworked the internals of mapper.cascade_iterator() toMike Bayer2010-10-013-17/+35
| | | | | cut down method calls by about 9% in some circumstances. [ticket:1932]
* - Fixed bug whereby columns on a mixin wouldn't propagateMike Bayer2010-09-281-1/+1
| | | | | | | correctly to a single-table inheritance scheme where the attribute name is different than that of the column. [ticket:1930]. Note [ticket:1931] which is the same issue for joined inh, not yet resolved.
* fix the default hereMike Bayer2010-09-251-1/+1
|
* doc editsMike Bayer2010-09-222-9/+13
|
* - in depth docs about some merge() tipsMike Bayer2010-09-224-3/+25
| | | | | | | | | | | | - docs about backref cascade - Another new flag on relationship(), cascade_backrefs, disables the "save-update" cascade when the event was initiated on the "reverse" side of a bidirectional relationship. This is a cleaner behavior so that many-to-ones can be set on a transient object without it getting sucked into the child object's session, while still allowing the forward collection to cascade. We *might* default this to False in 0.7.
* - Query.select_from() has been beefed up to helpMike Bayer2010-09-211-13/+19
| | | | | | | | ensure that a subsequent call to query.join() will use the select_from() entity, assuming it's a mapped entity and not a plain selectable, as the default "left" side, not the first entity in the Query object's list of entities.
* - Patched a case where query.join() would adapt theMike Bayer2010-09-211-6/+20
| | | | | right side to the right side of the left's join inappropriately [ticket:1925]
* - scoped_session emits a warning when configure() isMike Bayer2010-09-211-2/+9
| | | | | called if a Session is already present (checks only the current thread) [ticket:1924]
* - fix test_single test to use default dialectMike Bayer2010-09-153-19/+43
| | | | | | | | | | | | | | | | | | | | | | | - The exception raised by Session when it is used subsequent to a subtransaction rollback (which is what happens when a flush fails in autocommit=False mode) has now been reworded (this is the "inactive due to a rollback in a subtransaction" message). In particular, if the rollback was due to an exception during flush(), the message states this is the case, and reiterates the string form of the original exception that occurred during flush. If the session is closed due to explicit usage of subtransactions (not very common), the message just states this is the case. - The exception raised by Mapper when repeated requests to its initialization are made after initialization already failed no longer assumes the "hasattr" case, since there's other scenarios in which this message gets emitted, and the message also does not compound onto itself multiple times - you get the same message for each attempt at usage. The misnomer "compiles" is being traded out for "initialize".
* - Fixed a regression in 0.6.5 which occurred if youMike Bayer2010-09-151-1/+1
| | | | | passed an empty list to "include_properties" on mapper() [ticket:1918]
* - add message to documentation stating that collection validators cannotMike Bayer2010-09-151-0/+5
| | | | load the collection being validated. [ticket:1916]
* - Fixed bug that would prevent "subqueryload" fromMike Bayer2010-09-132-3/+13
| | | | | | | | | | | | working correctly with single table inheritance for a relationship from a subclass - the "where type in (x, y, z)" only gets placed on the inside, instead of repeatedly. - When using from_self() with single table inheritance, the "where type in (x, y, z)" is placed on the outside of the query only, instead of repeatedly. May make some more adjustments to this.
* - Fixed recursion bug which could occur when movingMike Bayer2010-09-133-9/+9
| | | | | | | an object from one reference to another, with backrefs involved, where the initiating parent was a subclass (with its own mapper) of the previous parent.
* more docs on thisMike Bayer2010-09-122-13/+17
|
* need this tooMike Bayer2010-09-121-0/+2
|
* - lazy loads for relationship attributes now useMike Bayer2010-09-128-59/+105
| | | | | | | | | | | | | | | | | | | | | the current state, not the "committed" state, of foreign and primary key attributes when issuing SQL, if a flush is not in process. Previously, only the database-committed state would be used. In particular, this would cause a many-to-one get()-on-lazyload operation to fail, as autoflush is not triggered on these loads when the attributes are determined and the "committed" state may not be available. [ticket:1910] - A new flag on relationship(), load_on_pending, allows the lazy loader to fire off on pending objects without a flush taking place, as well as a transient object that's been manually "attached" to the session. Note that this flag blocks attribute events from taking place when an object is loaded, so backrefs aren't available until after a flush. The flag is only intended for very specific use cases.
* - Slight improvement to the behavior of "passive_updates=False"Mike Bayer2010-09-122-5/+12
| | | | | | | | | | | when placed only on the many-to-one side of a relationship; documentation has been clarified that passive_updates=False should really be on the one-to-many side. - Placing passive_deletes=True on a many-to-one emits a warning, since you probably intended to put it on the one-to-many side.
* - collection docsMike Bayer2010-09-092-4/+13
| | | | | | | | - Added an assertion during flush which ensures that no NULL-holding identity keys were generated on "newly persistent" objects. This can occur when user defined code inadvertently triggers flushes on not-fully-loaded objects.
* - add doc pages for exceptionsMike Bayer2010-09-091-1/+1
|
* editsMike Bayer2010-09-081-9/+12
|
* - Added a mutex to the identity map which mutexesMike Bayer2010-09-071-28/+49
| | | | | | | | remove operations against iteration methods, which now pre-buffer before returning an iterable. This because asyncrhonous gc can remove items via the gc thread at any time. [ticket:1891]
* - pending deprecation in 0.7 for the execute/scalar on clauseelementMike Bayer2010-09-071-1/+1
|
* unify query.with_parent, util.with_parent, fix docs some moreMike Bayer2010-09-062-50/+46
|
* doc updatesMike Bayer2010-09-062-6/+13
|
* merge doc fixes from tipMike Bayer2010-09-061-1/+1
|\
| * fixesMike Bayer2010-09-051-1/+1
| |
* | - query.with_parent() now accepts transient objectsMike Bayer2010-09-063-31/+68
|/ | | | | | | and will use the non-persistent values of their pk/fk attributes in order to formulate the criterion. Docs are also clarified as to the purpose of with_parent(). - fix for PG test executing an alias()
* merge tipMike Bayer2010-09-051-0/+12
|\
| * - mapper _get_col_to_prop private method usedMike Bayer2010-09-051-0/+12
| | | | | | | | | | | | | | | | by the versioning example is deprecated; now use mapper.get_property_by_column() which will remain the public method for this. - turned TODO in the history example into an assertion with a descriptive reason
* | roughly the finished product.Mike Bayer2010-09-041-13/+45
| |
* | almost through.Mike Bayer2010-09-044-75/+22
| |