def object_update(self, obj_type, obj_uuid, new_obj_dict, uuid_batch=None):
    obj_class = self._get_resource_class(obj_type)
    new_ref_infos = {}
    symmetric_ref_updates = []
    new_props = {}
    for prop_field in obj_class.prop_fields:
        if (prop_field in new_obj_dict):
            new_props[prop_field] = new_obj_dict[prop_field]
    for ref_field in obj_class.ref_fields:
        ref_fld_types_list = list(obj_class.ref_field_types[ref_field])
        ref_res_type = ref_fld_types_list[0]
        ref_link_type = ref_fld_types_list[1]
        is_weakref = ref_fld_types_list[2]
        ref_obj_type = self._get_resource_class(ref_res_type).object_type
        if (ref_field in new_obj_dict):
            new_refs = new_obj_dict[ref_field]
            new_ref_infos[ref_obj_type] = {}
            for new_ref in (new_refs or []):
                try:
                    new_ref_uuid = new_ref['uuid']
                except KeyError:
                    new_ref_uuid = self.fq_name_to_uuid(ref_obj_type, new_ref['to'])
                new_ref_attr = new_ref.get('attr')
                new_ref_data = {'attr': new_ref_attr, 'is_weakref': is_weakref}
                new_ref_infos[ref_obj_type][new_ref_uuid] = new_ref_data
    if uuid_batch:
        bch = uuid_batch
    else:
        bch = self._cassandra_driver.get_cf_batch(datastore_api.OBJ_UUID_CF_NAME)
    for (col_name, col_value) in self._cassandra_driver.xget(datastore_api.OBJ_UUID_CF_NAME, obj_uuid):
        if self._is_prop(col_name):
            (_, prop_name) = col_name.split(':')
            if (prop_name == 'id_perms'):
                new_id_perms = new_obj_dict.get(prop_name, json.loads(col_value))
                self.update_last_modified(bch, obj_type, obj_uuid, new_id_perms)
            elif (prop_name in new_obj_dict):
                self._update_prop(bch, obj_uuid, prop_name, new_props)
        if self._is_prop_list(col_name):
            (_, prop_name, prop_elem_position) = col_name.split(':', 2)
            if (prop_name in new_props):
                self._delete_from_prop_list(bch, obj_uuid, prop_name, prop_elem_position)
        if self._is_prop_map(col_name):
            (_, prop_name, prop_elem_position) = col_name.split(':', 2)
            if (prop_name in new_props):
                self._delete_from_prop_map(bch, obj_uuid, prop_name, prop_elem_position)
        if self._is_ref(col_name):
            (_, ref_type, ref_uuid) = col_name.split(':')
            ret = self._update_ref(bch, obj_type, obj_uuid, ref_type, ref_uuid, new_ref_infos)
            symmetric_ref_updates.extend(ret)
    for ref_type in list(new_ref_infos.keys()):
        for ref_uuid in list(new_ref_infos[ref_type].keys()):
            ref_data = new_ref_infos[ref_type][ref_uuid]
            ret = self._create_ref(bch, obj_type, obj_uuid, ref_type, ref_uuid, ref_data)
            symmetric_ref_updates.extend(ret)
    for prop_name in list(new_props.keys()):
        if (prop_name in obj_class.prop_list_fields):
            if (obj_class.prop_list_field_has_wrappers[prop_name] and new_props[prop_name]):
                wrapper_field = list(new_props[prop_name].keys())[0]
                list_coll = new_props[prop_name][wrapper_field]
            else:
                list_coll = new_props[prop_name]
            for i in range(len(list_coll)):
                self._add_to_prop_list(bch, obj_uuid, prop_name, list_coll[i], str(i))
        elif (prop_name in obj_class.prop_map_fields):
            if (obj_class.prop_map_field_has_wrappers[prop_name] and new_props[prop_name]):
                wrapper_field = list(new_props[prop_name].keys())[0]
                map_coll = new_props[prop_name][wrapper_field]
            else:
                map_coll = new_props[prop_name]
            map_key_name = obj_class.prop_map_field_key_names[prop_name]
            for map_elem in map_coll:
                map_key = map_elem[map_key_name]
                self._set_in_prop_map(bch, obj_uuid, prop_name, map_elem, map_key)
        else:
            self._create_prop(bch, obj_uuid, prop_name, new_props[prop_name])
    if (not uuid_batch):
        try:
            bch.send()
        finally:
            self._obj_cache_mgr.evict(obj_type, [obj_uuid])
    return (True, symmetric_ref_updates)
def object_update(self, obj_type, obj_uuid, new_obj_dict, uuid_batch=None):
    obj_class = self._get_resource_class(obj_type)
    new_ref_infos = {}
    symmetric_ref_updates = []
    new_props = {}
    for prop_field in obj_class.prop_fields:
        if (prop_field in new_obj_dict):
            new_props[prop_field] = new_obj_dict[prop_field]
    for ref_field in obj_class.ref_fields:
        ref_fld_types_list = list(obj_class.ref_field_types[ref_field])
        ref_res_type = ref_fld_types_list[0]
        ref_link_type = ref_fld_types_list[1]
        is_weakref = ref_fld_types_list[2]
        ref_obj_type = self._get_resource_class(ref_res_type).object_type
        if (ref_field in new_obj_dict):
            new_refs = new_obj_dict[ref_field]
            new_ref_infos[ref_obj_type] = {}
            for new_ref in (new_refs or []):
                try:
                    new_ref_uuid = new_ref['uuid']
                except KeyError:
                    new_ref_uuid = self.fq_name_to_uuid(ref_obj_type, new_ref['to'])
                new_ref_attr = new_ref.get('attr')
                new_ref_data = {'attr': new_ref_attr, 'is_weakref': is_weakref}
                new_ref_infos[ref_obj_type][new_ref_uuid] = new_ref_data
    if uuid_batch:
        bch = uuid_batch
    else:
        bch = self._cassandra_driver.get_cf_batch(datastore_api.OBJ_UUID_CF_NAME)
    for (col_name, col_value) in self._cassandra_driver.xget(datastore_api.OBJ_UUID_CF_NAME, obj_uuid):
        if self._is_prop(col_name):
            (_, prop_name) = col_name.split(':')
            if (prop_name == 'id_perms'):
                new_id_perms = new_obj_dict.get(prop_name, json.loads(col_value))
                self.update_last_modified(bch, obj_type, obj_uuid, new_id_perms)
            elif (prop_name in new_obj_dict):
                self._update_prop(bch, obj_uuid, prop_name, new_props)
        if self._is_prop_list(col_name):
            (_, prop_name, prop_elem_position) = col_name.split(':', 2)
            if (prop_name in new_props):
                self._delete_from_prop_list(bch, obj_uuid, prop_name, prop_elem_position)
        if self._is_prop_map(col_name):
            (_, prop_name, prop_elem_position) = col_name.split(':', 2)
            if (prop_name in new_props):
                self._delete_from_prop_map(bch, obj_uuid, prop_name, prop_elem_position)
        if self._is_ref(col_name):
            (_, ref_type, ref_uuid) = col_name.split(':')
            ret = self._update_ref(bch, obj_type, obj_uuid, ref_type, ref_uuid, new_ref_infos)
            symmetric_ref_updates.extend(ret)
    for ref_type in list(new_ref_infos.keys()):
        for ref_uuid in list(new_ref_infos[ref_type].keys()):
            ref_data = new_ref_infos[ref_type][ref_uuid]
            ret = self._create_ref(bch, obj_type, obj_uuid, ref_type, ref_uuid, ref_data)
            symmetric_ref_updates.extend(ret)
    for prop_name in list(new_props.keys()):
        if (prop_name in obj_class.prop_list_fields):
            if (obj_class.prop_list_field_has_wrappers[prop_name] and new_props[prop_name]):
                wrapper_field = list(new_props[prop_name].keys())[0]
                list_coll = new_props[prop_name][wrapper_field]
            else:
                list_coll = new_props[prop_name]
            for i in range(len(list_coll)):
                self._add_to_prop_list(bch, obj_uuid, prop_name, list_coll[i], str(i))
        elif (prop_name in obj_class.prop_map_fields):
            if (obj_class.prop_map_field_has_wrappers[prop_name] and new_props[prop_name]):
                wrapper_field = list(new_props[prop_name].keys())[0]
                map_coll = new_props[prop_name][wrapper_field]
            else:
                map_coll = new_props[prop_name]
            map_key_name = obj_class.prop_map_field_key_names[prop_name]
            for map_elem in map_coll:
                map_key = map_elem[map_key_name]
                self._set_in_prop_map(bch, obj_uuid, prop_name, map_elem, map_key)
        else:
            self._create_prop(bch, obj_uuid, prop_name, new_props[prop_name])
    if (not uuid_batch):
        try:
            bch.send()
        finally:
            self._obj_cache_mgr.evict(obj_type, [obj_uuid])
    return (True, symmetric_ref_updates)