'Make our cell info map match the db.'

def _refresh_cells_from_dict(self, db_cells_dict):

    for cells_dict in (self.parent_cells, self.child_cells):
        for (cell_name, cell_info) in cells_dict.items():
            is_parent = cell_info.db_info['is_parent']
            db_dict = db_cells_dict.get(cell_name)
            if (db_dict and (is_parent == db_dict['is_parent'])):
                cell_info.update_db_info(db_dict)
            else:
                del cells_dict[cell_name]
    for (cell_name, db_info) in db_cells_dict.items():
        if db_info['is_parent']:
            cells_dict = self.parent_cells
        else:
            cells_dict = self.child_cells
        if (cell_name not in cells_dict):
            cells_dict[cell_name] = self.cell_state_cls(cell_name)
            cells_dict[cell_name].update_db_info(db_info)
