def has_joins(queryset):
    for join in six.itervalues(queryset.query.alias_map):
        if join.join_type:
            return True
    return False
Return True iff. a queryset includes joins.
dataset/ETHPy150Open AltSchool/dynamic-rest/dynamic_rest/filters.py/has_joins