@classmethod
def recursive(cls, make_cte_queryset, name='cte'):
    """Recursive Common Table Expression: `WITH RECURSIVE ...`

        :param make_cte_queryset: Function taking a single argument (a
        not-yet-fully-constructed cte object) and returning a `QuerySet`
        object. The returned `QuerySet` normally consists of an initial
        statement unioned with a recursive statement.
        :param name: See `name` parameter of `__init__`.
        :returns: The fully constructed recursive cte object.
        """
    cte = cls(None, name)
    cte.query = make_cte_queryset(cte).query
    return cte
