@classmethod
    def detach_from_model(cls, instance, graph_type=None):
        if graph_type is None:
            graph_type = consts.DEFAULT_DEPLOYMENT_GRAPH_TYPE
        existing_graph = cls.get_for_model(instance, graph_type)
        if existing_graph:
            association = cls.get_association_for_model(instance)
            instance.deployment_graphs_assoc.filter(
                association.type == graph_type
            ).delete()
            db().flush()
            logger.debug(
                'Graph with ID={0} was detached from model {1} with ID={2}'
                .format(existing_graph.id, instance, instance.id))
            return existing_graph
Given a list of locations, generate the footprint of those by walking up parents.
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/objects/deployment_graph.py/DeploymentGraph.detach_from_model--crossover with--dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/locations/fixtures.py/_location_footprint