def METHOD_NAME(self, base, key, recursive=True):
    new_relation = []
    for relation in base[key]:
        if relation["type"] == "file":
            new_relation.append(self.mwdb.query_file(relation["id"]).data)
        elif relation["type"] == "static_config":
            new_relation.append(self.mwdb.query_config(relation["id"]).data)
    base[key] = new_relation
    # HERE WE GO
    if recursive:
        for new_base in base[key]:
            if base["type"] == "file":
                # otherwise we have an infinite loop
                if key == "parents":
                    self.METHOD_NAME(new_base, key="parents", recursive=True)
                    self.METHOD_NAME(new_base, key="children", recursive=False)
                elif key == "children":
                    self.METHOD_NAME(new_base, key="parents", recursive=True)
                    self.METHOD_NAME(new_base, key="children", recursive=False)