summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/dynamic.py
Commit message (Collapse)AuthorAgeFilesLines
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - remove some old cruftMike Bayer2014-09-071-3/+1
| | | | | | - prop.compare() isn't needed; replace with prop._with_parent() for relationships - update docs in orm/interfaces
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-39/+41
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* - Fixed bug involving dynamic attributes, that was again a regressionMike Bayer2014-06-261-2/+3
| | | | | | of :ticket:`3060` from verision 0.9.5. A self-referential relationship with lazy='dynamic' would raise a TypeError within a flush operation. fixes #3099
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - the wrapped memoized_property here was not working, as the attribute nameMike Bayer2013-11-261-2/+7
| | | | didn't match. use straight memoized_props here for now, add a perf test to check it
* - merge ticket_1418 branch, [ticket:1418]Mike Bayer2013-10-061-1/+1
| | | | | | | | | | | | | - The system of loader options has been entirely rearchitected to build upon a much more comprehensive base, the :class:`.Load` object. This base allows any common loader option like :func:`.joinedload`, :func:`.defer`, etc. to be used in a "chained" style for the purpose of specifying options down a path, such as ``joinedload("foo").subqueryload("bar")``. The new system supersedes the usage of dot-separated path names, multiple attributes within options, and the usage of ``_all()`` options. - Added a new load option :func:`.orm.load_only`. This allows a series of column names to be specified as loading "only" those attributes, deferring the rest.
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-141-1/+2
| | | | | | | | | - rework the event system so that event modules load after their targets, dependencies are reversed - create an improved strategy lookup system for the ORM - rework the ORM to have very few import cycles - move out "importlater" to just util.dependency - other tricks to cross-populate modules in as clear a way as possible
* - A large refactoring of the ``sqlalchemy.sql`` package has reorganizedMike Bayer2013-08-121-4/+1
| | | | | | | | | | | | | | | | | | | | | | the import structure of many core modules. ``sqlalchemy.schema`` and ``sqlalchemy.types`` remain in the top-level package, but are now just lists of names that pull from within ``sqlalchemy.sql``. Their implementations are now broken out among ``sqlalchemy.sql.type_api``, ``sqlalchemy.sql.sqltypes``, ``sqlalchemy.sql.schema`` and ``sqlalchemy.sql.ddl``, the last of which was moved from ``sqlalchemy.engine``. ``sqlalchemy.sql.expression`` is also a namespace now which pulls implementations mostly from ``sqlalchemy.sql.elements``, ``sqlalchemy.sql.selectable``, and ``sqlalchemy.sql.dml``. Most of the "factory" functions used to create SQL expression objects have been moved to classmethods or constructors, which are exposed in ``sqlalchemy.sql.expression`` using a programmatic system. Care has been taken such that all the original import namespaces remain intact and there should be no impact on any existing applications. The rationale here was to break out these very large modules into smaller ones, provide more manageable lists of function names, to greatly reduce "import cycles" and clarify the up-front importing of names, and to remove the need for redundant functions and documentation throughout the expression package.
* - The mechanism by which attribute events pass along anMike Bayer2013-07-261-2/+5
| | | | | | | | | | | | | | | | | | | :class:`.AttributeImpl` as an "initiator" token has been changed; the object is now an event-specific object called :class:`.attributes.Event`. Additionally, the attribute system no longer halts events based on a matching "initiator" token; this logic has been moved to be specific to ORM backref event handlers, which are the typical source of the re-propagation of an attribute event onto subsequent append/set/remove operations. End user code which emulates the behavior of backrefs must now ensure that recursive event propagation schemes are halted, if the scheme does not use the backref handlers. Using this new system, backref handlers can now peform a "two-hop" operation when an object is appended to a collection, associated with a new many-to-one, de-associated with the previous many-to-one, and then removed from a previous collection. Before this change, the last step of removal from the previous collection would not occur. [ticket:2789]
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* - add tests to ensure SELECT of dynamic collection not emittedMike Bayer2012-12-221-0/+3
| | | | | | on regular append/remove history - fix the real cause of the original #2637 issue, backrefs call upon the "pop()" method now which wasn't implemented for Dynamic
* - revert the full iteration of the collection for a passive history event; ↵Mike Bayer2012-12-221-5/+11
| | | | | | | that's the wrong behavior, and for the original #2637 issue we will have to fix the association proxy, which is #2642
* - significantly rework the approach to collection events and history within ↵Mike Bayer2012-12-211-61/+83
| | | | | | | | | | DynamicAttributeImpl - Fixes to the "dynamic" loader on :func:`.relationship`, includes that backrefs will work properly even when autoflush is disabled, history events are more accurate in scenarios where multiple add/remove of the same object occurs, as can often be the case in conjunction with the association proxy. [ticket:2637]
* - cleanup on these testsMike Bayer2012-12-211-0/+6
| | | | - add "extend()" to AppenderQuery
* just a pep8 pass of lib/sqlalchemy/orm/Diana Clarke2012-11-191-7/+11
|
* - [bug] An error is emitted when uselist=FalseMike Bayer2012-08-051-2/+6
| | | | | is combined with a "dynamic" loader. This is a warning in 0.7.9.
* - [feature] A warning is emitted when a referenceMike Bayer2012-08-041-0/+1
| | | | | | | | | to an instrumented collection is no longer associated with the parent class due to expiration/attribute refresh/collection replacement, but an append or remove operation is received on the now-detached collection. [ticket:2476]
* -whitespace bonanza, contdMike Bayer2012-07-281-13/+13
|
* - move all of orm to use absolute importsMike Bayer2012-06-231-12/+9
| | | | | | | | - break out key mechanics of loading objects into new "orm.loading" module, removing implementation details from both mapper.py and query.py. is analogous to persistence.py - some other cleanup and old cruft removal
* merge patch for [ticket:2208]. This still needs documentation.Mike Bayer2012-04-231-1/+1
|\
| * - the inspect interface is done, needs docs.Mike Bayer2012-04-041-1/+1
| | | | | | | | | | - start dressing up InstanceState for it's coming out, start moving internal things to be underscored within the lib
* | - merge attribute flag overhaul for [ticket:2358]Mike Bayer2012-04-231-4/+6
|/
* happy new yearMike Bayer2012-01-041-1/+1
|
* - attribute system gets a pop() method.Mike Bayer2011-10-301-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - remove() on a scalar object will raise if the object removed is not what was present. - InstanceState can be pickled if obj() is None; this to support the other changes in this commit - only use trackparent flag on attributes if single_parent or ONETOMANY; otherwise we can skip this overhead - attribute hasparent()/sethasparent() check that trackparent is set, else their usage is invalid - [bug] Fixed backref behavior when "popping" the value off of a many-to-one in response to a removal from a stale one-to-many - the operation is skipped, since the many-to-one has since been updated. [ticket:2315] - [bug] After some years of not doing this, added more granularity to the "is X a parent of Y" functionality, which is used when determining if the FK on "Y" needs to be "nulled out" as well as if "Y" should be deleted with delete-orphan cascade. The test now takes into account the Python identity of the parent as well its identity key, to see if the last known parent of Y is definitely X. If a decision can't be made, a StaleDataError is raised. The conditions where this error is raised are fairly rare, requiring that the previous parent was garbage collected, and previously could very well inappropriately update/delete a record that's since moved onto a new parent, though there may be some cases where "silent success" occurred previously that will now raise in the face of ambiguity. Expiring "Y" resets the "parent" tracker, meaning X.remove(Y) could then end up deleting Y even if X is stale, but this is the same behavior as before; it's advised to expire X also in that case. [ticket:2264]
* - remove test.sql._base, test.engine._base, test.orm._base, move those ↵Mike Bayer2011-03-271-1/+1
| | | | | | | classes to a new test.lib.fixtures module - move testing.TestBase to test.lib.fixtures - massive search and replace
* - replace all usage of True and False for passive with PASSIVE_NO_INITIALIZE,Mike Bayer2011-02-111-16/+19
| | | | | | PASSIVE_OFF, now expresed as non-boolean symbols - make "passive" available positionally on all get_history() methods, call it like that
* - whitespace removal bonanzaMike Bayer2011-01-021-7/+7
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-2/+2
| | | | | a consistent tag - AUTHORS file
* - removes the "on_" prefix.Mike Bayer2010-12-301-2/+2
|
* - slight simplify to state.modified_event()Mike Bayer2010-12-231-4/+2
|
* - modest inlinings into the MapperProperty.setup/row_processor chainMike Bayer2010-12-201-3/+0
|
* - further optimize what get_all_pending() returns to reduce the work of ↵Mike Bayer2010-12-191-3/+5
| | | | receivers
* - inlinings and callcount reductionsMike Bayer2010-12-121-1/+1
| | | | - add test coverage for the rare case of noload->lazyload + pickle
* - shave about a millisecond off of moderately complex save casades.Mike Bayer2010-12-061-2/+8
|
* - merge hybrid attributes branch, [ticket:1903]Mike Bayer2010-11-201-1/+1
|\
| * merge tipMike Bayer2010-11-141-1/+1
| |\
| * \ merge tipMike Bayer2010-09-141-1/+1
| |\ \
| * | | - step one, remove "resolve_synonyms" and start using class attributeMike Bayer2010-08-061-1/+1
| | | | | | | | | | | | | | | | access to get at mapped properties by name
* | | | - merge tipMike Bayer2010-11-061-1/+1
|\ \ \ \ | | |_|/ | |/| |
| * | | - Added a new "lazyload" option "immediateload".Mike Bayer2010-10-151-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | 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]
* | | - merge tip, 0.6.4 + 0.6.5Mike Bayer2010-09-141-1/+1
|\ \ \ | |/ /
| * | - Fixed recursion bug which could occur when movingMike Bayer2010-09-131-1/+1
| |/ | | | | | | | | | | | | 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.
* | - get active_history to work, move attribute events into module-level classesMike Bayer2010-09-031-6/+7
|/
* - Dynamic attributes don't support collectionMike Bayer2010-08-051-13/+26
| | | | | | | | population - added an assertion for when set_committed_value() is called, as well as when joinedload() or subqueryload() options are applied to a dynamic attribute, instead of failure / silent failure. [ticket:1864]
* fix importMike Bayer2010-06-171-1/+1
|
* - session.merge() will not expire attributes on the returnedMike Bayer2010-05-081-2/+2
| | | | instance if that instance is "pending". [ticket:1789]
* - The official name for the relation() function is nowMike Bayer2010-03-171-1/+1
| | | | | | relationship(), to eliminate confusion over the relational algebra term. relation() however will remain available in equal capacity for the foreseeable future. [ticket:1740]
* Gave the "state" internals a good solidMike Bayer2010-02-141-1/+5
| | | | | cleanup with less complexity, datamembers, method calls, blank dictionary creates.