def where_node_children(node):
    todo = [node]
    get_field_name = ((lambda n: n.lhs.target.name) if django.VERSION >= (1, 7) else
                      (lambda n: n[0].field.name))
    while todo:
        node = todo.pop()
        for child in node.children:
            try:
                field_name = get_field_name(child)
            except (TypeError, AttributeError):
                pass
            else:
                yield child, field_name
            if isinstance(child, WhereNode):
                todo.append(child)

#===============================================================================
# Query manipulations
Simple exception handler to allow post-completion status.
dataset/ETHPy150Open KristianOellegaard/django-hvad/hvad/query.py/where_node_children--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/gsutil/gslib/commands/perfdiag.py/_PerfdiagExceptionHandler