Updates the attributes of the record of type _class_or_classname_ and specified by _record_id_ with the values of _new_attrs_ in the Force.com database. _new_attrs_ is a hash of attribute => value

    client.update("Car", "rid", {"Color" => "Red"})
779413
def update(class_or_classname, record_id, new_attrs)
      class_or_classname = find_or_materialize(class_or_classname)
      json_for_update = coerced_json(new_attrs, class_or_classname)
      http_patch("/services/data/v#{self.version}/sobjects/#{class_or_classname.sobject_name}/#{record_id}", json_for_update)
    end
590428
def update(self, attributes=None):
        

        if attributes is None:
            attributes = {}

        attributes['content_type_id'] = self.sys['content_type'].id

        return super(Entry, self).update(attributes)
1359204
def database_cached_attribute(*attrs)
      attrs.each do |attr|
        define_method("invalidate_#{attr}") do |arg=nil| # default arg to allow before_blah callbacks
          invalidate_cache attr.to_sym
        end

        define_method("only_#{attr}_changed?") do 
          only_change? attr.to_sym
        end

        define_method("cache_#{attr}") do
          update_cache attr.to_sym
        end
      end
    end
336247
def update_attributes(attributes)
      attributes.each { |attribute, value| write_attribute(attribute, value) }
      save
    end
980524
def update_fields_in_record(model, name_or_id, record_field, record_value)
      workitem[PERSIST_META] = true
      workitem[UPDATE_META] = true
      workitem[MODEL_META] = model
      workitem[RECORD_ID_META] = name_or_id.to_s
      workitem[RECORD_FIELD_META] = record_field
      workitem[RECORD_VALUE_META] = record_value

      send_workitem_message

      workitem.delete(PERSIST_META)
      workitem.delete(UPDATE_META)
    end
832493
def add_attribute(attr,**kwargs):
    
    log.debug("Adding attribute: %s", attr.name)

    try:
        attr_i = db.DBSession.query(Attr).filter(Attr.name == attr.name,
                                                 Attr.dimension_id == attr.dimension_id).one()
        log.info("Attr already exists")
    except NoResultFound:
        attr_i = Attr(name = attr.name, dimension_id = attr.dimension_id)
        attr_i.description = attr.description
        db.DBSession.add(attr_i)
        db.DBSession.flush()
        log.info("New attr added")
    return JSONObject(attr_i)
1089317
def update_user_attributes(self, id, old_attrs, new_attrs):
        
        from alerta.utils.collections import merge
        merge(old_attrs, new_attrs)
        attrs = {k: v for k, v in old_attrs.items() if v is not None}
        update = {
            '$set': {'attributes': attrs}
        }
        response = self.get_db().users.update_one({'_id': {'$regex': '^' + id}}, update=update)
        return response.matched_count > 0
878220
def coerced_attributes
      attrs = []

      if new_record?
        attributes.each do |k, v|
          attrs << k << coerce_for_persistence(v) if (self.class.attributes[k][:default] || nil) != v
        end
      else
        changed_attributes.each_key do |key|
          attrs << key << coerce_for_persistence(attributes[key])
        end
      end

      attrs
    end
1276794
def can_upgrade?(records)
      query_attributes = @expose_attributes.select do |name|
        klass = self.class._attributes[name][:klass]
        if klass
          klass.ancestors.include?(Attributes::QueryAttribute)
        end
      end

      return true if query_attributes.empty?
      Array(records).all? do |record|
        query_attributes.all? do |name|
          adapter.has_attribute?(record, name)
        end
      end
    end
1264551
def update(self, *args, **kwargs):
        
        if args:
            self.database.hmset(self.key, *args)
        else:
            self.database.hmset(self.key, kwargs)
558633
def update(self, attrs):
        """"""
        self._validateAttrs(attrs)
        for k,v in attrs.items():
            typecast = type( getattr(self, k) )
            if typecast==bool and v=="False":   newval = False # "False" evalued as boolean is True because its length > 0
            else:                               newval = typecast(v.lower())
            setattr(self, k, newval)
1181877
def update(attrs)
      old_attrs = @attributes.dup
      Model.no_change_tracking do
        assign_all_attributes(attrs, false)

        validate!.then do |errs|
          if errs && errs.present?
            # Revert wholesale
            @attributes = old_attrs
            Promise.new.resolve(errs)
          else
            # Persist
            persist_changes(nil)
          end
        end
      end
    end
391562
def _update_record(attribute_names = self.attribute_names)
      attribute_names = attributes_for_update(attribute_names)

      if attribute_names.empty?
        affected_rows = 0
        @_trigger_update_callback = true
      else
        affected_rows = _update_row(attribute_names)
        @_trigger_update_callback = affected_rows == 1
      end

      yield(self) if block_given?

      affected_rows
    end
420216
def update(record)
      result = self.class.put(worksheet_url + "/" + record.id,
        :body => { "fields" => record.fields_for_update }.to_json,
        :headers => { "Content-type" => "application/json" }).parsed_response

      check_and_raise_error(result)

      record.override_attributes!(result_attributes(result))
      record

    end
1068576
def update(attribute_names = @attributes.keys)
      attributes_with_values = arel_attributes_values(false, false, attribute_names)
      return 0 if attributes_with_values.empty?
      klass = self.class
      stmt = klass.unscoped.where(klass.arel_table[klass.primary_key].eq(id)).arel.compile_update(attributes_with_values)
      klass.connection.update stmt
    end
437524
def update(instance, full_clean=True, post_save=False, **kwargs):
    ""

    # apply the updated args to the instance to mimic the change
    # note that these might slightly differ from the true database values
    # as the DB could have been updated by another thread. callers should
    # retrieve a new copy of the object if up-to-date values are required
    for k, v in kwargs.iteritems():
        if isinstance(v, ExpressionNode):
            v = resolve_expression_node(instance, v)
        setattr(instance, k, v)

    # clean instance before update
    if full_clean:
        instance.full_clean()

    # fields that use auto_now=True should be updated corrected, too!
    for field in instance._meta.fields:
        if hasattr(field, 'auto_now') and field.auto_now and field.name not in kwargs:
            kwargs[field.name] = field.pre_save(instance, False)

    rows_affected = instance.__class__._default_manager.filter(
        pk=instance.pk).update(**kwargs)

    if post_save:
        signals.post_save.send(sender=instance.__class__, instance=instance)

    return rows_affected
617609
def update_attributes(self, event, channel, attr):
        """"""
        try:
            for i, sensor in enumerate(self.event_states[event]):
                if sensor[1] == int(channel):
                    self.event_states[event][i] = attr
        except KeyError:
            _LOGGING.debug('Error updating attributes for: (%s, %s)',
                           event, channel)