'Convert a project_ref from v3 to v2.
* v2.0 projects are not domain aware, and should have domain_id removed
* v2.0 projects are not hierarchy aware, and should have parent_id
removed
This method should only be applied to project_refs being returned from
the v2.0 controller(s).
If ref is a list type, we will iterate through each element and do the
conversion.'

@staticmethod
def v3_to_v2_project(ref):

    def _filter_project_properties(ref):
        'Run    through    the    various    filter    methods.'
        V2Controller.filter_domain_id(ref)
        V2Controller.filter_project_parent_id(ref)
        V2Controller.filter_is_domain(ref)
        return ref
    if isinstance(ref, dict):
        return _filter_project_properties(ref)
    elif isinstance(ref, list):
        return [_filter_project_properties(x) for x in ref]
    else:
        raise ValueError((_('Expected    dict    or    list:    %s') % type(ref)))
