def put(self, resource_name=None, input_dict=None, silent=False, as_update=True): if not resource_name: resource_name = self.resource_name if as_update: resource = common.get_resource(self.client, resource_name, options=self.options) resource[resource_name].update(input_dict) else: resource = WryDict({resource_name: input_dict}) response = common.put_resource(self.client, resource, silent=silent, options=self.options) print response
def put(self, resource_name=None, input_dict=None, silent=False, as_update=True): # Ideally want keyword-only args or a refactor here. # Want to be able to supply only input_dict... if not resource_name: resource_name = self.resource_name if as_update: resource = common.get_resource(self.client, resource_name, options=self.options) resource[resource_name].update(input_dict) else: resource = WryDict({resource_name: input_dict}) response = common.put_resource(self.client, resource, silent=silent, options=self.options)
def put_resource(self, data, uri=None, silent=False): ''' Given a WryDict describing a resource, put this data to the client. ''' return common.put_resource(self.client, data, uri, options=self.options, silent=silent)