summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/relationships.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix indentation issues in docstringspr/43Vraj Mohan2013-11-121-2/+3
|
* An overhaul of expression handling for special symbols particularlyMike Bayer2013-10-231-1/+1
| | | | | | | | | | 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]
* these are in alphabetical orderMike Bayer2013-10-131-21/+21
|
* - Added new option to :func:`.relationship` ``distinct_target_key``.Mike Bayer2013-10-131-0/+23
| | | | | | | | | | | | | | | This enables the subquery eager loader strategy to apply a DISTINCT to the innermost SELECT subquery, to assist in the case where duplicate rows are generated by the innermost query which corresponds to this relationship (there's not yet a general solution to the issue of dupe rows within subquery eager loading, however, when joins outside of the innermost subquery produce dupes). When the flag is set to ``True``, the DISTINCT is rendered unconditionally, and when it is set to ``None``, DISTINCT is rendered if the innermost relationship targets columns that do not comprise a full primary key. The option defaults to False in 0.8 (e.g. off by default in all cases), None in 0.9 (e.g. automatic by default). Thanks to Alexander Koval for help with this. [ticket:2836]
* - merge ticket_1418 branch, [ticket:1418]Mike Bayer2013-10-061-5/+6
| | | | | | | | | | | | | - 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-5/+1587
| | | | | | | | | - 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
* - improve overlapping selectables, apply to both query and relationshipMike Bayer2013-06-041-6/+2
| | | | | | - clean up inspect() calls within query._join() - make sure join.alias(flat) propagates - fix almost all assertion tests
* Fixes to the ``sqlalchemy.ext.serializer`` extension, includingMike Bayer2013-04-261-2/+13
| | | | | | | that the "id" passed from the pickler is turned into a string to prevent against bytes being parsed on Py3K, as well as that ``relationship()`` and ``orm.join()`` constructs are now properly serialized. [ticket:2698] and some other observed issues.
* lintingMike Bayer2013-03-091-15/+12
|
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* just a pep8 pass of lib/sqlalchemy/orm/Diana Clarke2012-11-191-42/+43
|
* - remove remote_foreign annotationMike Bayer2012-10-281-48/+15
| | | | - support annotations on Column where name isn't immediately present
* - fix annotation transfer when producing m2m backref, [ticket:2578]Mike Bayer2012-09-281-0/+14
|
* trailing whitespace bonanzaMike Bayer2012-07-281-69/+69
|
* - move all of orm to use absolute importsMike Bayer2012-06-231-11/+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
* Add some `Sphinx` paragraph level versions informations markups,Mike Bayer2012-06-081-4/+4
| | | | such as ``.. versionadded::``, ``.. versionchanged::`` and ``.. deprecated::``.
* get __clause_element__ for remote()/foreign() annotation, [ticket:2493]Mike Bayer2012-05-241-2/+2
|
* - identify another condition, indirectly via #2491, whereMike Bayer2012-05-241-5/+6
| | | | | remote/local detection was regressing vs. 0.7. use a more liberal check for "tables overlap".
* document the remote/foreign/remote_foreign functionsMike Bayer2012-04-241-0/+63
|
* - put the correct target here in the log messageMike Bayer2012-04-241-6/+6
|
* - merged #1401 branch from bitbucketMike Bayer2012-04-221-8/+29
| | | | | | | | | | | | | | | | | | | | | | - resolved some serious speed hits I missed, we need to ensure only deannotated columns are used in the local/remote collections and soforth so that hash lookups against mapped columns don't dig into __eq__() - fix some other parity mismatches regarding stuff from [ticket:2453], including finding another case where _deep_annotate() was doing the wrong thing, new tests. - [feature] Major rewrite of relationship() internals now allow join conditions which include columns pointing to themselves within composite foreign keys. A new API for very specialized primaryjoin conditions is added, allowing conditions based on SQL functions, CAST, etc. to be handled by placing the annotation functions remote() and foreign() inline within the expression when necessary. Previous recipes using the semi-private _local_remote_pairs approach can be upgraded to this new approach. [ticket:1401]
* then spiff up that error msgMike Bayer2012-04-031-2/+7
|
* - move create_lazy_clause() to relationshipsMike Bayer2012-04-011-64/+66
| | | | - add foreign, remote annotations to declarative
* almost through all the fine tuningMike Bayer2012-02-251-17/+27
|
* start to work on error messages, allow foreign_keys as only argumentMike Bayer2012-02-251-15/+56
| | | | if otherwise can't determine join condition due to no fks
* - figured out again why deannotate must clone()Mike Bayer2012-02-111-163/+194
| | | | | - got everything working. just need to update error strings
* many fixes but still can't get heuristics to work as well as what's existing,Mike Bayer2012-02-111-1/+5
| | | | tests still failing
* - move properties to use the new create_joinsMike Bayer2012-02-101-1/+2
| | | | - fix up subquery eager loading
* fix up this testMike Bayer2012-02-101-1/+0
|
* - got m2m, local_remote_pairs, etc. workingMike Bayer2012-02-091-272/+175
| | | | | | | | - using new traversal that returns the product of both sides of a binary, starting to work with (a+b) == (c+d) types of joins. primaryjoins on functions working - annotations working, including reversing local/remote when doing backref
* - hooks in the new object to RelationshipProperty, restores the "local" ↵Mike Bayer2012-02-081-38/+90
| | | | | | annotation. also added in sync pairs, etc. many-to-many is currently broken.
* simplify remote annotation significantly, and alsoMike Bayer2012-02-081-125/+112
| | | | catch the actual remote columns more accurately.
* local_remote_pairs/remote_side are comparing against existingMike Bayer2012-02-061-248/+53
| | | | 100%
* this version has easy cases going well. hard cases not so muchMike Bayer2012-02-061-40/+293
|
* proof of concept. relationships.JoinCondition is givenMike Bayer2012-02-061-0/+742
everything known about the relationship in an ORM-agnostic way. The primaryjoin is determined as before, but is then immediately parsed and annotated with "foreign", "local" and "remote" annotations. These annotations will then drive the additional decisions made, namely "direction" and "sync pairs". The end user will be able to pass a pre-annotated join condition in which case those annotations take effect as given, which will in one pass fix both #1401 as well as #610 (for #610, the "foreign" / "remote" annotation can recursively descend down to ColumnElement objects).