series as well. For changes that are specific to 1.0 with an emphasis
on compatibility concerns, see :doc:`/changelog/migration_10`.
+ .. change::
+ :tags: feature, orm
+ :tickets: 3217
+
+ Added a parameter :paramref:`.Query.join.isouter` which is synonymous
+ with calling :meth:`.Query.outerjoin`; this flag is to provide a more
+ consistent interface compared to Core :meth:`.FromClause.join`.
+ Pull request courtesy Jonathan Vanasco.
+
.. change::
:tags: bug, sql
:tickets: 3243
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.
+ just as if the :meth:`.Query.outerjoin` method were called. This
+ flag is here to maintain consistency with the same flag as accepted
+ by :meth:`.FromClause.join` and other Core constructs.
+
+
+ .. versionadded:: 1.0.0
+
: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
sess.query(literal_column('x'), User).join, Address
)
+ def test_isouter_flag(self):
+ User = self.classes.User
+
+ self.assert_compile(
+ create_session().query(User).join('orders', isouter=True),
+ "SELECT users.id AS users_id, users.name AS users_name "
+ "FROM users LEFT OUTER JOIN orders ON users.id = orders.user_id"
+ )
+
+
def test_multi_tuple_form(self):
"""test the 'tuple' form of join, now superseded
by the two-element join() form.
filter_by(id=3).outerjoin('orders','address').filter_by(id=1).all()
assert [User(id=7, name='jack')] == result
- def test_overlapping_paths_join_isouter(self):
- User = self.classes.User
-
- result = create_session().query(User).join('orders', 'items', isouter=True).\
- filter_by(id=3).join('orders','address', isouter=True).filter_by(id=1).all()
- assert [User(id=7, name='jack')] == result
-
def test_from_joinpoint(self):
Item, User, Order = (self.classes.Item,
self.classes.User,