summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/query.py
Commit message (Collapse)AuthorAgeFilesLines
* - reverse order of columns in sample CTEs as this is a UNION and the cols ↵Mike Bayer2014-04-021-1/+1
| | | | | | | | | | need to line up - alter this in the unit tests as well as these queries were just copied from the tests - remove the included_parts.join(parts) from the core CTE doc (also just copied from the test, where we want to make sure joins don't get screwed up with the CTE) as it doesn't contribute to the query itself fixes #3014
* - Fixes to the newly enhanced boolean coercion in :ticket:`2804` whereMike Bayer2014-04-011-1/+1
| | | | | | | the new rules for "where" and "having" woudn't take effect for the "whereclause" and "having" kw arguments of the :func:`.select` construct, which is also what :class:`.Query` uses so wasn't working in the ORM either. fixes #3013 re: #2804
* - Fixed regression from 0.8.3 as a result of :ticket:`2818`Mike Bayer2014-03-221-1/+8
| | | | | | where :meth:`.Query.exists` wouldn't work on a query that only had a :meth:`.Query.select_from` entry but no other entities. re: #2818 fixes #2995
* - Improved an error message which would occur if a query() were madeMike Bayer2014-03-171-0/+6
| | | | | | | against a non-selectable, such as a :func:`.literal_column`, and then an attempt was made to use :meth:`.Query.join` such that the "left" side would be determined as ``None`` and then fail. This condition is now detected explicitly.
* - correct this to make the intention clearMike Bayer2014-03-131-2/+1
|
* - extensive cross-linking of relationship options with their documentation ↵Mike Bayer2014-02-161-7/+7
| | | | | | sections - convert all paramter references in relationship documentation to :paramref:
* - 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 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]
* - 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]
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - 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-301-2/+2
|
* fix doc targetMike Bayer2013-12-191-1/+1
|
* - 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
| |
* | Merge branch 'master' of github.com:vrajmohan/sqlalchemy into mmMike Bayer2013-11-141-4/+4
|\ \
| * | Fix cross referencespr/44Vraj Mohan2013-11-141-2/+2
| | |
| * | Fix indentation and escape *args and **kwargsVraj Mohan2013-11-131-2/+2
| | |
* | | Fixed bug where usage of new :class:`.Bundle` object would causeMike Bayer2013-11-131-1/+1
|/ / | | | | | | the :attr:`.Query.column_descriptions` attribute to fail.
* | Fix cross referencesVraj Mohan2013-11-121-5/+5
|/
* - Fixed a regression introduced by :ticket:`2818` where the EXISTSMike Bayer2013-10-301-1/+1
| | | | | | query being generated would produce a "columns being replaced" warning for a statement with two same-named columns, as the internal SELECT wouldn't have use_labels set.
* An overhaul of expression handling for special symbols particularlyMike Bayer2013-10-231-2/+3
| | | | | | | | | | with conjunctions, e.g. ``None`` :func:`.expression.null` :func:`.expression.true` :func:`.expression.false`, including consistency in rendering NULL in conjunctions, "short-circuiting" of :func:`.and_` and :func:`.or_` expressions which contain boolean constants, and rendering of boolean constants and expressions as compared to "1" or "0" for backends that don't feature ``true``/``false`` constants. [ticket:2804]
* - add an option to Bundle single_entity=True to allow for singleMike Bayer2013-10-071-1/+22
| | | | entity returns without otherwise changing much [ticket:2824]
* - merge ticket_1418 branch, [ticket:1418]Mike Bayer2013-10-061-20/+10
| | | | | | | | | | | | | - 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.
* fix entity_zero resolutionMike Bayer2013-10-041-1/+10
|
* - A new construct :class:`.Bundle` is added, which allows for specificationMike Bayer2013-10-031-6/+168
| | | | | | | | | | | | | | | | of groups of column expressions to a :class:`.Query` construct. The group of columns are returned as a single tuple by default. The behavior of :class:`.Bundle` can be overridden however to provide any sort of result processing to the returned row. One example included is :attr:`.Composite.Comparator.bundle`, which applies a bundled form of a "composite" mapped attribute. [ticket:2824] - The :func:`.composite` construct now maintains the return object when used in a column-oriented :class:`.Query`, rather than expanding out into individual columns. This makes use of the new :class:`.Bundle` feature internally. This behavior is backwards incompatible; to select from a composite column which will expand out, use ``MyClass.some_composite.clauses``.
* Fixed Query.exists() method for the case, when query doesn't have any ↵Vladimir Magamedov2013-09-041-1/+1
| | | | filters applied.
* - "primary mapper entity" is now an attribute on Query,Mike Bayer2013-08-241-16/+11
| | | | | | | | making _MapperEntity slightly less dependent on a particular parent Query (in theory more shareable by multiple Query objects in different contexts) - remove some comments that have been misunderstanding what _mapper_entities does, or perhaps forgot to get removed - simplify _mapper_entities
* - also do delete, add seealsos, formatting, etc. [ticket:2798]Mike Bayer2013-08-181-13/+37
|
* - add better notes to query.update(), most notably how to deal with a joined ↵Mike Bayer2013-08-181-12/+36
| | | | | | table update, [ticket:2798]
* - spot checking of imports, obsolete functionsMike Bayer2013-08-171-6/+4
|
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-141-7/+37
| | | | | | | | | - 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-5/+2
| | | | | | | | | | | | | | | | | | | | | | 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.
* find some more inline imports and move them outMike Bayer2013-08-041-1/+1
|
* wording about supported dialects for Query.yield_perpr/17Domen Kožar2013-07-141-6/+6
|
* remove undoc-members from query docstring [ticket:2774]Mike Bayer2013-07-071-0/+7
|
* - fix a regression caused by #2587, where query.join() would apply anMike Bayer2013-06-271-1/+1
| | | | | adapter to an aliased-mapped, non-polymorphic selectable that prevented us from referring directly to that selectable.
* Fixed bug in polymorphic SQL generation where multiple joined-inheritanceMike Bayer2013-06-151-5/+10
| | | | | | | entities against the same base class joined to each other as well would not track columns on the base table independently of each other if the string of joins were more than two entities long. Also in 0.8.2. [ticket:2759]
* dial back the default "flatness" a bit, it will be there for joinedload and ↵Mike Bayer2013-06-061-1/+1
| | | | | | | query.join(), but if you're dealing with aliased() or with_polymorphic() you need to say "flat=True". Just the one flag though, "flat" implies "aliased".
* shrugsMike Bayer2013-06-051-1/+6
|
* a test for what's breaking, plus a non-working fix for it...Mike Bayer2013-06-051-0/+3
|
* - improve overlapping selectables, apply to both query and relationshipMike Bayer2013-06-041-17/+15
| | | | | | - clean up inspect() calls within query._join() - make sure join.alias(flat) propagates - fix almost all assertion tests
* rewriting scheme now works.Mike Bayer2013-06-041-6/+3
|
* OK this is the broken version, need to think a lot more about thisMike Bayer2013-06-031-2/+2
|