def union(self, *q):
    "Produce a UNION of this Query against one or more queries.\n\n        e.g.::\n\n            q1 = sess.query(SomeClass).filter(SomeClass.foo=='bar')\n            q2 = sess.query(SomeClass).filter(SomeClass.bar=='foo')\n\n            q3 = q1.union(q2)\n\n        The method accepts multiple Query objects so as to control\n        the level of nesting.  A series of ``union()`` calls such as::\n\n            x.union(y).union(z).all()\n\n        will nest on each ``union()``, and produces::\n\n            SELECT * FROM (SELECT * FROM (SELECT * FROM X UNION\n                            SELECT * FROM y) UNION SELECT * FROM Z)\n\n        Whereas::\n\n            x.union(y, z).all()\n\n        produces::\n\n            SELECT * FROM (SELECT * FROM X UNION SELECT * FROM y UNION\n                            SELECT * FROM Z)\n\n        Note that many database backends do not allow ORDER BY to\n        be rendered on a query called within UNION, EXCEPT, etc.\n        To disable all ORDER BY clauses including those configured\n        on mappers, issue ``query.order_by(None)`` - the resulting\n        :class:`.Query` object will not render ORDER BY within\n        its SELECT statement.\n\n        "
    return self._from_selectable(expression.union(*([self] + list(q))))
Produce a UNION of this Query against one or more queries.

e.g.::

    q1 = sess.query(SomeClass).filter(SomeClass.foo=='bar')
    q2 = sess.query(SomeClass).filter(SomeClass.bar=='foo')

    q3 = q1.union(q2)

The method accepts multiple Query objects so as to control
the level of nesting.  A series of ``union()`` calls such as::

    x.union(y).union(z).all()

will nest on each ``union()``, and produces::

    SELECT * FROM (SELECT * FROM (SELECT * FROM X UNION
                    SELECT * FROM y) UNION SELECT * FROM Z)

Whereas::

    x.union(y, z).all()

produces::

    SELECT * FROM (SELECT * FROM X UNION SELECT * FROM y UNION
                    SELECT * FROM Z)

Note that many database backends do not allow ORDER BY to
be rendered on a query called within UNION, EXCEPT, etc.
To disable all ORDER BY clauses including those configured
on mappers, issue ``query.order_by(None)`` - the resulting
:class:`.Query` object will not render ORDER BY within
its SELECT statement.
def union(self, *q):
    "Produce a UNION of this Query against one or more queries.\n\n        e.g.::\n\n            q1 = sess.query(SomeClass).filter(SomeClass.foo=='bar')\n            q2 = sess.query(SomeClass).filter(SomeClass.bar=='foo')\n\n            q3 = q1.union(q2)\n\n        The method accepts multiple Query objects so as to control\n        the level of nesting.  A series of ``union()`` calls such as::\n\n            x.union(y).union(z).all()\n\n        will nest on each ``union()``, and produces::\n\n            SELECT * FROM (SELECT * FROM (SELECT * FROM X UNION\n                            SELECT * FROM y) UNION SELECT * FROM Z)\n\n        Whereas::\n\n            x.union(y, z).all()\n\n        produces::\n\n            SELECT * FROM (SELECT * FROM X UNION SELECT * FROM y UNION\n                            SELECT * FROM Z)\n\n        Note that many database backends do not allow ORDER BY to\n        be rendered on a query called within UNION, EXCEPT, etc.\n        To disable all ORDER BY clauses including those configured\n        on mappers, issue ``query.order_by(None)`` - the resulting\n        :class:`.Query` object will not render ORDER BY within\n        its SELECT statement.\n\n        "
    return self._from_selectable(expression.union(*([self] + list(q))))