def with_transformation(self, fn):
    'Return a new :class:`.Query` object transformed by\n        the given function.\n\n        E.g.::\n\n            def filter_something(criterion):\n                def transform(q):\n                    return q.filter(criterion)\n                return transform\n\n            q = q.with_transformation(filter_something(x==5))\n\n        This allows ad-hoc recipes to be created for :class:`.Query`\n        objects.  See the example at :ref:`hybrid_transformers`.\n\n        .. versionadded:: 0.7.4\n\n        '
    return fn(self)
Return a new :class:`.Query` object transformed by
the given function.

E.g.::

    def filter_something(criterion):
        def transform(q):
            return q.filter(criterion)
        return transform

    q = q.with_transformation(filter_something(x==5))

This allows ad-hoc recipes to be created for :class:`.Query`
objects.  See the example at :ref:`hybrid_transformers`.

.. versionadded:: 0.7.4
def with_transformation(self, fn):
    'Return a new :class:`.Query` object transformed by\n        the given function.\n\n        E.g.::\n\n            def filter_something(criterion):\n                def transform(q):\n                    return q.filter(criterion)\n                return transform\n\n            q = q.with_transformation(filter_something(x==5))\n\n        This allows ad-hoc recipes to be created for :class:`.Query`\n        objects.  See the example at :ref:`hybrid_transformers`.\n\n        .. versionadded:: 0.7.4\n\n        '
    return fn(self)