'Get the IDs from the projects in the subtree from a given project.
The project IDs are returned as a structured dictionary representing
their hierarchy. For example, considering the following project
hierarchy::
A
+-B-+
C   D
If we query for project A subtree, the expected return is the following
dictionary::
\'subtree\': {
B[\'id\']: {
C[\'id\']: None,
D[\'id\']: None'

def get_projects_in_subtree_as_ids(self, project_id):

    def _projects_indexed_by_parent(projects_list):
        projects_by_parent = {}
        for proj in projects_list:
            parent_id = proj.get('parent_id')
            if parent_id:
                if (parent_id in projects_by_parent):
                    projects_by_parent[parent_id].append(proj)
                else:
                    projects_by_parent[parent_id] = [proj]
        return projects_by_parent
    subtree_list = self.list_projects_in_subtree(project_id)
    subtree_as_ids = self._build_subtree_as_ids_dict(project_id, _projects_indexed_by_parent(subtree_list))
    return subtree_as_ids
