summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/query.py
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* - pulling out more aliases, sort ofMike Bayer2013-06-031-4/+9
|
* working through tests....Mike Bayer2013-06-021-5/+21
|
* - figured out what the from_self() thing was about, part of query.statement, ↵Mike Bayer2013-06-021-0/+2
| | | | | | but would like to improve upon query.statement needing to do this
* getting things to join without subqueries, but some glitches in the compiler ↵Mike Bayer2013-06-021-8/+8
| | | | | | step when we do query.count() are showing
* - blow away context._attributesMike Bayer2013-06-021-1/+1
| | | | | - to account for query._attributes/context.attributes, just pass the attributes dict directly to the PathRegistry methods
* The "auto-aliasing" behavior of the :class:`.Query.select_from`Mike Bayer2013-05-301-11/+130
| | | | | | method has been turned off. The specific behavior is now availble via a new method :class:`.Query.select_entity_from`. [ticket:2736]
* repair py3kisms in key ORM modulesMike Bayer2013-05-261-11/+11
|
* most of ORM passing...Mike Bayer2013-05-041-6/+1
|
* - the raw 2to3 runMike Bayer2013-04-271-21/+22
| | | | - went through examples/ and cleaned out excess list() calls
* - further cleanup. in particular, the left clause is never None. But we stillMike Bayer2013-04-251-24/+12
| | | | can have errors when we do the auto-join, these are both covered in test_joins
* - attempt to replace the whole idea of "join_to_left" with a moreMike Bayer2013-04-241-26/+2
| | | | | fundamental and general purpose heuristic. this initial approach has about 60 tests failing but seems to have gone pretty far
* adding convenience method exists() to Query (see # 2673)Diana Clarke2013-03-291-0/+20
|
* Fixed bug whereby :meth:`.Query.yield_per` would set the executionMike Bayer2013-02-081-2/+2
| | | | | | options incorrectly, thereby breaking subsequent usage of the :meth:`.Query.execution_options` method. Courtesy Ryan Kelly. [ticket:2661]
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* The :meth:`.Query.select_from` method can now be used with aMike Bayer2012-12-131-18/+18
| | | | | :func:`.aliased` construct without it interfering with the entities being selected. [ticket:2635]
* - refactor of pathing mechanics, to address #2614, #2617Mike Bayer2012-12-011-12/+25
| | | | | | | | | | | | | | | | | | | - paths now store Mapper + MapperProperty now instead of string key, so that the parent mapper for the property is known, supports same-named properties on multiple subclasses - the Mapper within the path is now always relevant to the property to the right of it. PathRegistry does the translation now, instead of having all the outside users of PathRegistry worry about it, to produce a path that is much more consistent. Paths are now consistent with mappings in all cases. Special logic to get at "with_polymorphic" structures and such added also. - AliasedClass now has two modes, "use_mapper_path" and regular; "use_mapper_path" is for all those situations where we put an AliasedClass in for a plain class internally, and want it to "path" with the plain mapper. - The AliasedInsp is now the first class "entity" for an AliasedClass, and is passed around internally and used as attr._parententity and such. it is the AliasedClass analogue for Mapper.
* just a pep8 pass of lib/sqlalchemy/orm/Diana Clarke2012-11-191-87/+84
|
* should be 'where' not 'filter' #2546Diana Clarke2012-11-181-1/+1
|
* - more docsMike Bayer2012-10-261-2/+2
| | | | - it appears we can get rid of all those "XYZ_toplevel" names and use :doc:.
* - add class_ to AliasedInspMike Bayer2012-10-261-1/+0
| | | | | | - redefine inspect(Class.attrname).parent to be always an inspectable target; either Mapper or AliasedInsp - add most major features to 08 migration, document, link
* - some naming changes on PropComparator, Comparator:Mike Bayer2012-10-251-2/+3
| | | | | | | | | | | | | 1. all Comparators now have "parent" which is always the parent mapper or AliasedClass instance 2. only RelationshipProperty.Comparator has "mapper" now, which is the target mapper 3. The names "parententity" and "parentmapper" are underscored also improved the message with the "neither comparator nor instruentedattribute...." to include the classname + attribute name
* - [feature] The Query can now load entity/scalar-mixedMike Bayer2012-10-151-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | "tuple" rows that contain types which aren't hashable, by setting the flag "hashable=False" on the corresponding TypeEngine object in use. Custom types that return unhashable types (typically lists) can set this flag to False. [ticket:2592] - [bug] Applying a column expression to a select statement using a label with or without other modifying constructs will no longer "target" that expression to the underlying Column; this affects ORM operations that rely upon Column targeting in order to retrieve results. That is, a query like query(User.id, User.id.label('foo')) will now track the value of each "User.id" expression separately instead of munging them together. It is not expected that any users will be impacted by this; however, a usage that uses select() in conjunction with query.from_statement() and attempts to load fully composed ORM entities may not function as expected if the select() named Column objects with arbitrary .label() names, as these will no longer target to the Column objects mapped by that entity. [ticket:2591]
* - allow a __clause_element__() to be passed to query.filter() alsoMike Bayer2012-10-151-8/+1
|
* - add coverage for merge_result() [ticket:2588]Mike Bayer2012-10-111-2/+2
| | | | - pre-determine keys for the keyed tuples
* - [feature] Added reduce_columns() methodMike Bayer2012-07-281-7/+19
| | | | | | | | | | | | | | | to select() construct, replaces columns inline using the util.reduce_columns utility function to remove equivalent columns. reduce_columns() also adds "with_only_synonyms" to limit the reduction just to those columns which have the same name. The deprecated fold_equivalents() feature is removed [ticket:1729]. - [feature] Added with_labels and reduce_columns keyword arguments to Query.subquery(), to provide two alternate strategies for producing queries with uniquely- named columns. [ticket:1729].
* - [feature] ORM entities can be passedMike Bayer2012-07-231-4/+9
| | | | | | | to select() as well as the select_from(), correlate(), and correlate_except() methods, where they will be unwrapped into selectables. [ticket:2245]
* - a big renaming of all the _Underscore classes to haveMike Bayer2012-07-171-8/+8
| | | | | | plain names. The old names are still defined for backwards compatibility. - _BindParamClause renamed to BindParameter
* - totally remove _entity_info and _extended_entity_info, replacing all usageMike Bayer2012-07-161-17/+31
| | | | with inspect()
* - express most of the orm.util functions in terms of the inspection systemMike Bayer2012-07-161-235/+234
| | | | | | | | | | | | | | - modify inspection system: 1. raise a new exception for any case where the inspection context can't be returned. this supersedes the "not mapped" errors. 2. don't configure mappers on a mapper inspection. this allows the inspectors to be used during mapper config time. instead, the mapper configures on "with_polymorphic_selectable" now, which is needed for all queries - add a bunch of new "is_XYZ" attributes to inspectors - finish making the name change of "compile" -> "configure", for some reason this was only done partially
* - fix this importMike Bayer2012-06-231-1/+1
| | | | - call loading.instances
* - move all of orm to use absolute importsMike Bayer2012-06-231-235/+62
| | | | | | | | - 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
* - simplify setup_entity and related callsMike Bayer2012-06-231-132/+142
| | | | - break _compile_context() into three methods
* - [feature] The of_type() construct on attributesMike Bayer2012-06-201-36/+32
| | | | | | | | | | | | | | | | | | | | | | | | now accepts aliased() class constructs as well as with_polymorphic constructs, and works with query.join(), any(), has(), and also eager loaders subqueryload(), joinedload(), contains_eager() [ticket:2438] [ticket:1106] - a rewrite of the query path system to use an object based approach for more succinct usage. the system has been designed carefully to not add an excessive method overhead. - [feature] select() features a correlate_except() method, auto correlates all selectables except those passed. Is needed here for the updated any()/has() functionality. - remove some old cruft from LoaderStrategy, init(),debug_callable() - use a namedtuple for _extended_entity_info. This method should become standard within the orm internals - some tweaks to the memory profile tests, number of runs can be customized to work around pysqlite's very annoying behavior - try to simplify PropertyOption._get_paths(), rename to _process_paths(), returns a single list now. overall works more completely as was needed for of_type() functionality
* Add some `Sphinx` paragraph level versions informations markups,Mike Bayer2012-06-081-31/+35
| | | | such as ``.. versionadded::``, ``.. versionchanged::`` and ``.. deprecated::``.
* doc update regarding with_lockmode, [ticket:2440]Mike Bayer2012-05-041-1/+1
|
* Add some documentation sugar for ``having`` criterion.Priit Laes2012-01-131-3/+15
|
* - refactor query.update() and query.delete() to use a pureMike Bayer2012-04-291-288/+108
| | | | | template method pattern using new class hierarchy BulkUD in sqlalchemy.orm.persistence
* - [feature] Calling rollback() within aMike Bayer2012-04-241-13/+21
| | | | | | | | | | | | | | session.begin_nested() will now only expire those objects that had net changes within the scope of that transaction, that is objects which were dirty or were modified on a flush. This allows the typical use case for begin_nested(), that of altering a small subset of objects, to leave in place the data from the larger enclosing set of objects that weren't modified in that sub-transaction. [ticket:2452] - inline the "register_newly_XYZ" functions to operate upon collections to reduce method calls
* - [bug] column.label(None) now produces anMike Bayer2012-04-241-2/+3
| | | | | | anonymous label, instead of returning the column object itself, consistent with the behavior of label(column, None). [ticket:2168]
* - [feature] New standalone function with_polymorphic()Mike Bayer2012-04-231-78/+75
| | | | | | | | | | | provides the functionality of query.with_polymorphic() in a standalone form. It can be applied to any entity within a query, including as the target of a join in place of the "of_type()" modifier. [ticket:2333] - redo a large portion of the inheritance docs in terms of declarative, new with_polymorphic() function - upgrade examples/inheritance/polymorph, rename to "joined"