Update a resource.
323357
def _update(self, request, *args, **kwargs):
        """"""
        partial = kwargs.pop('partial', False)
        # NOTE: The line below was changed.
        instance = self.get_object_with_lock()
        serializer = self.get_serializer(instance, data=request.data, partial=partial)
        serializer.is_valid(raise_exception=True)
        self.perform_update(serializer)

        if getattr(instance, '_prefetched_objects_cache', None):
            # If 'prefetch_related' has been applied to a queryset, we need to
            # forcibly invalidate the prefetch cache on the instance.
            instance._prefetched_objects_cache = {}  # pylint: disable=protected-access

        return Response(serializer.data)
806295
def update_admin_object_resource(name, server=None, **kwargs):
    '''
    
    '''
    if 'jndiName' in kwargs:
        del kwargs['jndiName']
    return _update_element(name, 'resources/admin-object-resource', kwargs, server)
312104
def _update(self, resource, update_dict=None, params=None, **kwargs):
        """"""
        url = self._client._build_url(resource, **kwargs)
        response = self._client._request('PUT', url, json=update_dict, params=params)

        if response.status_code != requests.codes.ok:  # pragma: no cover
            raise APIError("Could not update {} ({})".format(self.__class__.__name__, response.json().get('results')))
        else:
            self.refresh()
1232360
public function update_($resource, ...$id) {
		$this->_checkResource ( $resource, function () use ($id) {
			if (! $this->hasErrors ()) {
				parent::_update ( ...$id );
			} else {
				echo $this->displayErrors ();
			}
		} );
	}
461165
function update(req, res, next) {
    for (var key in req.body) {
      req.body[key] = utils.toNative(req.body[key])
    }
    var resource = db(req.params.resource)
      .update(utils.toNative(req._internal.filters.id), req.body)
    if (resource) {
      res.jsonp(resource)
    } else {
      res.status(404).jsonp({})
    }
  }
453414
def update(context, resource, **kwargs):
    """"""
    etag = kwargs.pop('etag')
    id = kwargs.pop('id')
    data = utils.sanitize_kwargs(**kwargs)
    uri = '%s/%s/%s' % (context.dci_cs_api, resource, id)
    r = context.session.put(uri, timeout=HTTP_TIMEOUT,
                            headers={'If-match': etag},
                            json=data)
    return r
175549
def update_resources_from_dict(self, res, types=None, names=None, 
                                   languages=None):
        
        UpdateResourcesFromDict(self.filename, res, types, names, 
                                languages)
799037
def update(connection, force_download):
    """"""
    manager.database.update(
        connection=connection,
        force_download=force_download
    )
594781
def update_line(self, resource_id, data):
        """"""
        return OrderLines(self.client).on(self).update(resource_id, data)
967583
def update(cls, id, params):
        """"""
        cls.echo('Updating your vlan.')
        result = cls.call('hosting.vlan.update', cls.usable_id(id), params)
        return result
130544
def update_resources(self, data, type_, names=None, languages=None):
        
        UpdateResources(self.filename, data, type_, names, languages)
275769
def update(self, **kwargs):
        ""
        kw = dict(index=self.name, doc_type=self.doc_type, ignore=[404])
        kw.update(**kwargs)
        return self._client.update(**kw)
201294
def update(self):
        
        if self._owner_changed:
            self.update_owner(self.owner)

        self._resources = [res.name for res in self.resources]
        return self.parent.update(self)
249081
def update_resource_entry(self, bundleId, languageId, resourceKey, data=None):
        """"""
        headers={'content-type':'application/json'}
        url = self.__get_base_bundle_url() + "/" + bundleId + "/" + languageId + "/" + resourceKey
        json_data = {}
        if not data is None:
            json_data = json.dumps(data)
        response = self.__perform_rest_call(requestURL=url, restType='POST', body=json_data, headers=headers)
        return response
903750
def update(self, *args, **kwargs):
        """"""
        self._call_helper("Updating", self.real.update, *args, **kwargs)
168492
def add(self, resource, replace=False):
        """"""
        uri = resource.uri
        if (uri in self and not replace):
            raise ResourceListDupeError(
                "Attempt to add resource already in resource_list")
        self[uri] = resource
749484
def update
      self.resource = find_resource
      
      respond_to do |format|
        if resource.update( resource_params )
          format.html { redirect_to resource_url, notice: "#{resource_name.humanize} was successfully updated." }
          format.js
          format.json { render :show, status: :ok, location: resource_url }
        else
          format.html { render :edit }
          format.js   { render :edit }
          format.json { render json: resource.errors, status: :unprocessable_entity }
        end
      end
    end