diff options
author | jonathan vanasco <jonathan@2xlp.com> | 2014-10-03 13:15:52 -0400 |
---|---|---|
committer | jonathan vanasco <jonathan@2xlp.com> | 2014-10-03 13:15:52 -0400 |
commit | 16d9d366bd80b3f9b42c89ceb3e392de15631188 (patch) | |
tree | d969f7fc3998d39619e5ffa6920e2c8d9a533638 /lib/sqlalchemy/orm/query.py | |
parent | 4da020dae324cb871074e302f4840e8731988be0 (diff) | |
download | sqlalchemy-16d9d366bd80b3f9b42c89ceb3e392de15631188.tar.gz |
* adding 'isouter=False' to sqlalchemy.orm.query.Query (https://bitbucket.org/zzzeek/sqlalchemy/issue/3217/make-join-more-standard-or-improve-error)
$ python setup.py develop
$ pip install nose
$ pip install mock
$ ./sqla_nose.py test.orm.test_joins
.....................................................................................................
----------------------------------------------------------------------
Ran 101 tests in 1.222s
OK
$ ./sqla_nose.py test.orm
......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S......................................................................................................................................................................................................................................................................................................................S.......................................................................................................................................................................................................................................................................................................................................................S.......S..S.SSS.SS...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S................................S..S........................S...........................................................................................SSS.S.........SSSSSSSS......SSSSSSSSS........SS...SS...............S.............................S..............................................................SS..SS..............................................................................................................S.
----------------------------------------------------------------------
Ran 3103 tests in 82.607s
OK (SKIP=46)
Diffstat (limited to 'lib/sqlalchemy/orm/query.py')
-rw-r--r-- | lib/sqlalchemy/orm/query.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 7b2ea7977..eaa3a8dcd 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -1740,6 +1740,8 @@ class Query(object): anonymously aliased. Subsequent calls to :meth:`~.Query.filter` and similar will adapt the incoming criterion to the target alias, until :meth:`~.Query.reset_joinpoint` is called. + :param isouter=False: If True, the join used will be a left outer join, + just as if the ``outerjoin()`` method were called. :param from_joinpoint=False: When using ``aliased=True``, a setting of True here will cause the join to be from the most recent joined target, rather than starting back from the original @@ -1757,13 +1759,15 @@ class Query(object): SQLAlchemy versions was the primary ORM-level joining interface. """ - aliased, from_joinpoint = kwargs.pop('aliased', False),\ - kwargs.pop('from_joinpoint', False) + aliased, from_joinpoint, isouter = kwargs.pop('aliased', False),\ + kwargs.pop('from_joinpoint', False),\ + kwargs.pop('isouter', False) if kwargs: raise TypeError("unknown arguments: %s" % ','.join(kwargs.keys)) + isouter = isouter return self._join(props, - outerjoin=False, create_aliases=aliased, + outerjoin=isouter, create_aliases=aliased, from_joinpoint=from_joinpoint) def outerjoin(self, *props, **kwargs): @@ -3385,7 +3389,6 @@ class _BundleEntity(_QueryEntity): self.supports_single_entity = self.bundle.single_entity - @property def entity_zero(self): for ent in self._entities: |