def destroy(self): """ 从服务器上删除这个对象 :rtype: None """ if not self.id: return False client.delete('/classes/{0}/{1}'.format(self._class_name, self.id))
def destroy(self): """ 从服务器上删除这个对象 :rtype: None """ if not self.id: return client.delete("/classes/{0}/{1}".format(self._class_name, self.id), self._flags)
def destroy_all(cls, objs): """ 在一个请求中 destroy 多个 leancloud.Object 对象实例。 :param objs: 需要 destroy 的对象 :type objs: list """ if not objs: return if not all(x._class_name == objs[0]._class_name for x in objs): raise ValueError("destroy_all requires the argument object list's _class_names must be the same") if any(x.is_new() for x in objs): raise ValueError("Could not destroy unsaved object") ids = {x.id for x in objs} ids = ','.join(ids) client.delete('/classes/{0}/{1}'.format(objs[0]._class_name, ids))
def destroy_all(self): """ 在服务器上删除所有满足查询条件的对象。 :raise: LeanCLoudError """ result = client.delete('/classes/{0}'.format(self._query_class._class_name), self.dump()) return result
def destroy_all(self): """ 在服务器上删除所有满足查询条件的对象。 :raise: LeanCLoudError """ result = client.delete( '/classes/{0}'.format(self._query_class._class_name), self.dump()) return result
def unfollow(self, target_id): """ 取消关注一个用户。 :param target_id: 需要关注的用户的 id :return: """ if self.id is None: raise ValueError("Please sign in") response = client.delete("/users/{0}/friendship/{1}".format(self.id, target_id), None) assert response.ok
def unfollow(self, target_id): """ 取消关注一个用户。 :param target_id: 需要关注的用户的 id :return: """ if self.id is None: raise ValueError('Please sign in') response = client.delete('/users/{0}/friendship/{1}'.format(self.id, target_id), None) assert response.ok
def destroy(self): if not self.id: return False response = client.delete('/files/{0}'.format(self.id)) if response.status_code != 200: raise LeanCloudError(1, "the file is not sucessfully destroyed")
def destroy(self): if not self.id: return False response = client.delete('/files/{0}'.format(self.id)) content = utils.response_to_json(response) return response
def destroy(self): if not self.id: return False response = client.delete('/files/{}'.format(self.id)) content = response.json() return response
def destroy(self): if not self.id: raise ValueError('This status is not saved') client.delete('/statuses/' + self.id)
def destroy(self): if not self.id: raise ValueError("This status is not saved") client.delete("/statuses/" + self.id)