summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm
Commit message (Collapse)AuthorAgeFilesLines
* - Fixed bug where :class:`.AbstractConcreteBase` would fail to beMike Bayer2014-02-112-4/+20
| | | | | | | | | | | | | | | | | | | | | fully usable within declarative relationship configuration, as its string classname would not be available in the registry of classnames at mapper configuration time. The class now explicitly adds itself to the class regsitry, and additionally both :class:`.AbstractConcreteBase` as well as :class:`.ConcreteBase` set themselves up *before* mappers are configured within the :func:`.configure_mappers` setup, using the new :meth:`.MapperEvents.before_configured` event. [ticket:2950] - Added new :meth:`.MapperEvents.before_configured` event which allows an event at the start of :func:`.configure_mappers`, as well as ``__declare_first__()`` hook within declarative to complement ``__declare_last__()``. - modified how after_configured is invoked; we just make a dispatch() not actually connected to any mapper. this makes it easier to also invoke before_configured correctly. - improved the ComparableEntity fixture to handle collections that are sets.
* - Fixed bug where :meth:`.Query.get` would fail to consistentlyMike Bayer2014-02-101-4/+11
| | | | | | raise the :class:`.InvalidRequestError` that invokes when called on a query with existing criterion, when the given identity is already present in the identity map. [ticket:2951]
* - Fixed an 0.9 regression where ORM instance or mapper events appliedMike Bayer2014-02-091-18/+12
| | | | | | | | to a base class such as a declarative base with the propagate=True flag would fail to apply to existing mapped classes which also used inheritance due to an assertion. Addtionally, repaired an attribute error which could occur during removal of such an event, depending on how it was first assigned. [ticket:2949]
* - Improved the initialization logic of composite attributes such thatMike Bayer2014-02-031-4/+5
| | | | | | calling ``MyClass.attribute`` will not require that the configure mappers step has occurred, e.g. it will just work without throwing any error. [ticket:2935]
* - Fixed bug in new :class:`.TextAsFrom` construct where :class:`.Column`-Mike Bayer2014-02-021-0/+1
| | | | | | | | | | oriented row lookups were not matching up to the ad-hoc :class:`.ColumnClause` objects that :class:`.TextAsFrom` generates, thereby making it not usable as a target in :meth:`.Query.from_statement`. Also fixed :meth:`.Query.from_statement` mechanics to not mistake a :class:`.TextAsFrom` for a :class:`.Select` construct. This bug is also an 0.9 regression as the :meth:`.Text.columns` method is called to accommodate the :paramref:`.text.typemap` argument. [ticket:2932]
* - Added a new directive used within the scope of an attribute "set" operationMike Bayer2014-01-313-3/+9
| | | | | | | | to disable autoflush, in the case that the attribute needs to lazy-load the "old" value, as in when replacing one-to-one values or some kinds of many-to-one. A flush at this point otherwise occurs at the point that the attribute is None and can cause NULL violations. [ticket:2921]
* - remove this leftover commented pdbMike Bayer2014-01-231-5/+0
|
* - Fixed an 0.9 regression where the automatic aliasing applied byMike Bayer2014-01-231-1/+0
| | | | | | | | | | :class:`.Query` and in other situations where selects or joins were aliased (such as joined table inheritance) could fail if a user-defined :class:`.Column` subclass were used in the expression. In this case, the subclass would fail to propagate ORM-specific "annotations" along needed by the adaptation. The "expression annotations" system has been corrected to account for this case. [ticket:2918]
* - Support is improved for supplying a :func:`.join` construct as theMike Bayer2014-01-223-6/+35
| | | | | | | | | | target of :paramref:`.relationship.secondary` for the purposes of creating very complex :func:`.relationship` join conditions. The change includes adjustments to query joining, joined eager loading to not render a SELECT subquery, changes to lazy loading such that the "secondary" target is properly included in the SELECT, and changes to declarative to better support specification of a join() object with classes as targets.
* Merge pull request #58 from kstark/patch-1mike bayer2014-01-141-1/+1
|\ | | | | Fix TypeError for class_mapper called w/ iterable
| * Fix TypeError for class_mapper called w/ iterablepr/58Kyle Stark2014-01-131-1/+1
| | | | | | When the class_ passed is not a mapped class but is actually an iterable, the string formatting operation fails with a TypeError, and the expected ArgumentError is not raised. Calling code which is using reflection and expects this error will fail (e.g. the sadisplay module).
* | - Fixed a bug involving the new flattened JOIN structures whichMike Bayer2014-01-131-4/+3
|/ | | | | | | | | | | are used with :func:`.joinedload()` (thereby causing a regression in joined eager loading) as well as :func:`.aliased` in conjunction with the ``flat=True`` flag and joined-table inheritance; basically multiple joins across a "parent JOIN sub" entity using different paths to get to a target class wouldn't form the correct ON conditions. An adjustment / simplification made in the mechanics of figuring out the "left side" of the join in the case of an aliased, joined-inh class repairs the issue. [ticket:2908]
* - happy new yearMike Bayer2014-01-0529-29/+29
|
* - fix some docstring stuffMike Bayer2014-01-051-5/+25
|
* Merge bitbucket.org:rschoon/sqlalchemy into tMike Bayer2014-01-021-1/+2
|\
| * Don't barf on Session(info=...) from sessionmaker(info=None)Robin Schoonover2013-12-311-1/+2
| |
* | - Fixed regression where we don't check the given name against theMike Bayer2014-01-021-1/+1
| | | | | | | | | | | | correct string class when setting up a backref based on a name, therefore causing the error "too many values to unpack". This was related to the Py3k conversion. [ticket:2901]
* | - Fixed regression where we apparently still create an implicitMike Bayer2014-01-021-4/+20
|/ | | | | | | | | | alias when saying query(B).join(B.cs), where "C" is a joined inh class; however, this implicit alias was created only considering the immediate left side, and not a longer chain of joins along different joined-inh subclasses of the same base. As long as we're still implicitly aliasing in this case, the behavior is dialed back a bit so that it will alias the right side in a wider variety of cases. [ticket:2903]
* - call it 0.9.0Mike Bayer2013-12-302-3/+3
|
* fix doc targetMike Bayer2013-12-191-1/+1
|
* - An adjustment to the :func:`.subqueryload` strategy which ensures thatMike Bayer2013-12-161-8/+32
| | | | | | | the query runs after the loading process has begun; this is so that the subqueryload takes precedence over other loaders that may be hitting the same attribute due to other eager/noload situations at the wrong time. [ticket:2887]
* - Fixed bug when using joined table inheritance from a table to aMike Bayer2013-12-161-1/+3
| | | | | | | select/alias on the base, where the PK columns were also not same named; the persistence system would fail to copy primary key values from the base table to the inherited table upon INSERT. [ticket:2885]
* wrong method nameMike Bayer2013-12-161-1/+1
|
* load_on_pending is different from enable_relationship_loading and shouldMike Bayer2013-12-152-6/+14
| | | | not be superseded. both have a potential use.
* make the error message for [ticket:2889] more accurate, as we supportMike Bayer2013-12-121-1/+1
| | | | composites to many-to-ones now also
* - :func:`.composite` will raise an informative error message when theMike Bayer2013-12-121-0/+5
| | | | | | columns/attribute (names) passed don't resolve to a Column or mapped attribute (such as an erroneous tuple); previously raised an unbound local. [ticket:2889]
* - Error message when a string arg sent to :func:`.relationship` whichMike Bayer2013-12-121-12/+10
| | | | | | | doesn't resolve to a class or mapper has been corrected to work the same way as when a non-string arg is received, which indicates the name of the relationship which had the configurational error. [ticket:2888]
* - The :class:`.exc.StatementError` or DBAPI-related subclassMike Bayer2013-12-111-1/+12
| | | | | | | | | | now can accomodate additional information about the "reason" for the exception; the :class:`.Session` now adds some detail to it when the exception occurs within an autoflush. This approach is taken as opposed to combining :class:`.FlushError` with a Python 3 style "chained exception" approach so as to maintain compatibility both with Py2K code as well as code that already catches ``IntegrityError`` or similar.
* - documentation cleanup in ORM including [ticket:2816]Mike Bayer2013-12-073-43/+88
|
* - Added new argument ``include_backrefs=True`` to theMike Bayer2013-12-023-12/+45
| | | | | | | :func:`.validates` function; when set to False, a validation event will not be triggered if the event was initated as a backref to an attribute operation from the other side. [ticket:1535] - break out validation tests into an updated module test_validators
* - changelogMike Bayer2013-11-301-7/+8
| | | | - put list.clear() instrumentation under "if not py2k"
* Merge branch 'orm-collections-list-clear' of ↵Mike Bayer2013-11-301-0/+8
|\ | | | | | | github.com:schettino72/sqlalchemy into list_clear
| * orm.collection, list.clear(). remove 'before_delete()', added unit-test.pr/40schettino722013-11-251-1/+0
| |
| * Add support for python3.3 list.clear() on orm.collectionsschettino722013-11-061-0/+9
| |
* | - re-document synonyms and remove warnings about "superseded"; synonymsMike Bayer2013-11-301-33/+50
| | | | | | | | | | are still useful, just include notes that for more complex descriptor operations, hybrids are probably preferable
* | Merge pull request #45 from timka/patch-1mike bayer2013-11-291-1/+1
|\ \ | | | | | | Fix sessionmaker.__repr__
| * | Fix sessionmaker.__repr__pr/45Timur2013-11-161-1/+1
| | | | | | | | | A comma separating 'class_' from the other args. It's still there even when kw is empty, which is syntactically correct.
* | | Merge pull request #46 from vrajmohan/mastermike bayer2013-11-293-6/+6
|\ \ \ | | | | | | | | More fixes for cross references and reducing warnings (3rd wave)
| * | | Fix cross referencespr/46Vraj Mohan2013-11-171-1/+1
| | | |
| * | | Generate API and resolve cross referencesVraj Mohan2013-11-172-5/+5
| |/ /
* | | - repair the "lockmode" functionality of load_on_ident(). slightly problematicMike Bayer2013-11-281-4/+9
| | | | | | | | | | | | here is that "lockmode" is also public in Session.refresh().
* | | - add support for specifying tables or entities for "of"Mike Bayer2013-11-281-36/+73
| | | | | | | | | | | | | | | - implement Query with_for_update() - rework docs and tests
* | | - fix up rendering of "of"Mike Bayer2013-11-281-2/+2
| | | | | | | | | | | | | | | | | | - move out tests, dialect specific out of compiler, compiler tests use new API, legacy API tests in test_selecatble - add support for adaptation of ForUpdateArg, alias support in compilers
* | | - work in progress, will squashMike Bayer2013-11-281-57/+2
| | |
* | | Merge branch 'for_update_of' of github.com:mlassnig/sqlalchemy into ↵Mike Bayer2013-11-281-30/+91
|\ \ \ | | | | | | | | | | | | for_update_of
| * | | added LockmodeArgspr/42Mario Lassnig2013-11-281-50/+84
| | | |
| * | | added ORM supportMario Lassnig2013-11-141-4/+20
| | | |
| * | | add psql FOR UPDATE OF functionalityMario Lassnig2013-11-121-1/+12
| | |/ | |/|
* | | - the wrapped memoized_property here was not working, as the attribute nameMike Bayer2013-11-262-12/+25
| | | | | | | | | | | | didn't match. use straight memoized_props here for now, add a perf test to check it
* | | - Some refinements to the :class:`.AliasedClass` construct with regardsMike Bayer2013-11-232-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to descriptors, like hybrids, synonyms, composites, user-defined descriptors, etc. The attribute adaptation which goes on has been made more robust, such that if a descriptor returns another instrumented attribute, rather than a compound SQL expression element, the operation will still proceed. Addtionally, the "adapted" operator will retain its class; previously, a change in class from ``InstrumentedAttribute`` to ``QueryableAttribute`` (a superclass) would interact with Python's operator system such that an expression like ``aliased(MyClass.x) > MyClass.x`` would reverse itself to read ``myclass.x < myclass_1.x``. The adapted attribute will also refer to the new :class:`.AliasedClass` as its parent which was not always the case before. [ticket:2872]