Gets passed the Salesforce outbound message hash of changed values and updates the corresponding model
480612
def salesforce_process_update(attributes = {})
      attributes_to_update = salesforce_attributes_to_set(self.new_record? ? attributes : salesforce_empty_attributes.merge(attributes)) # only merge empty attributes for updates, so we don't overwrite the default create attributes
      attributes_to_update.each_pair do |k, v|
        self.send("#{k}=", v)
      end

      # we don't want to keep going in a endless loop.  SF has just updated these values.
      self.salesforce_skip_sync = true
      self.save!
    end
439794
def update(attributes)
      response = JSON.parse(@client.patch("companies/#{attributes[:id]}", attributes).body)
      Promisepay::Company.new(@client, response['companies'])
    end
249147
def update(self, model):
        

        signals.pre_update.send(model.__class__, model=model)
        signals.pre_save.send(model.__class__, model=model)

        param = self.to_pg(model)
        param['rid_value'] = param[model.rid_field]

        query = """
                UPDATE {table}
                SET ({dirty_cols}) = ({dirty_vals})
                WHERE {rid_field} = %(rid_value)s
                RETURNING {cols};
                """

        query = query.format(
            cols=self.field_cols(model),
            dirty_cols=self.dirty_cols(model),
            dirty_vals=self.dirty_vals(model),
            rid_field=model.rid_field,
            table=model.rtype,
        )

        result = self.query(query, param=param)

        signals.post_update.send(model.__class__, model=model)
        signals.post_save.send(model.__class__, model=model)

        return model.merge(result[0], clean=True)
1215014
def _update_data(self, data={}):
        ''''''

        # Store the changes to prevent this update from affecting it
        pending_changes = self._changes or {}
        try:
            del self._changes
        except:
            pass

        # Map custom fields into our custom fields object
        try:
            custom_field_data = data.pop('custom_fields')
        except KeyError:
            pass
        else:
            self.custom_fields = Custom_Fields(custom_field_data)

        # Map all other dictionary data to object attributes
        for key, value in data.iteritems():
            lookup_key = self._field_type.get(key, key)

            # if it's a datetime object, turn into proper DT object
            if lookup_key == 'datetime' or lookup_key == 'date':
                self.__dict__[key] = datetime_parse(value)
            else:
                # Check to see if there's cache data for this item.
                # Will return an object if it's recognized as one.
                self.__dict__[key] = self._redmine.check_cache(lookup_key, value)


        # Set the changes dict to track all changes from here on out
        self._changes = pending_changes
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
241071
@Override
    public void update(AddressTemplate addressTemplate, List<Property> model) {
        switch (addressTemplate.getResourceType()) {
            case WebServicesStore.ENDPOINT_CONFIG:
                endpointConfigEditor.updateMaster(model);
                break;
            case WebServicesStore.CLIENT_CONFIG:
                clientConfigEditor.updateMaster(model);
                break;
        }
    }
1370144
function updateFee() {
		// Check for amount errors
		if(undefined === $("#amount").val() || !nem.utils.helpers.isTextAmountValid($("#amount").val())) return alert('Invalid amount !');

		// Set the cleaned amount into transfer transaction object
		transferTransaction.amount = nem.utils.helpers.cleanTextAmount($("#amount").val());

		// Set the message into transfer transaction object
		transferTransaction.message = $("#message").val();

		// Prepare the updated transfer transaction object
		var transactionEntity = nem.model.transactions.prepare("transferTransaction")(common, transferTransaction, nem.model.network.data.testnet.id);

		// Format fee returned in prepared object
		var feeString = nem.utils.format.nemValue(transactionEntity.fee)[0] + "." + nem.utils.format.nemValue(transactionEntity.fee)[1];

		//Set fee in view
		$("#fee").html(feeString);
	}
1336154
def m2m_changed_handler(sender, *args, **kwargs):
    
    action = kwargs['action']
    instance = kwargs['instance']
    logger.debug("m2m_changed: %s (%s) {%s}"%(sender, args, kwargs))

    bulk = []
    if is_df(instance) and (action in ['post_add', 'post_remove']):
        pk_set = list(kwargs.get('pk_set') or [])
        relation_name = sender._meta.db_table.replace(sender._meta.app_label + '_' + instance.__class__.__name__.lower() + '_', '')
        relations = {k.name:k for k in m2m_relations(instance)}
        field = relations[relation_name]
        for pk in pk_set:
            related_instance = get_relation(relations[relation_name]).objects.get(pk=pk)
            changes = {field.name: {'changed': [pk],
                                    'changed_to_string': six.text_type(related_instance)}}
            # reflect change
            bulk.append(History.objects.add(
                    action=action,
                    changes=changes,
                    model=instance,
                    commit=False,))
            # m2m to reflect on changes
            field = get_field(field)
            changes = {field.name: {'changed': [instance.pk],
                                    'changed_to_string': six.text_type(instance),
                                    'm2mpg': True,}}
            bulk.append(History.objects.add(
                    action='add' if action in ['post_add'] else 'rem',
                    changes=changes,
                    model=related_instance,
                    commit=False,))
    if is_df(instance) and (action in ['pre_clear']):
        # "For the pre_clear and post_clear actions, this is None."
        # TODO: should defer this until post_clear is done to be sure it happened
        # TODO: background job, optional execution
        relations = instance._meta.get_all_related_many_to_many_objects()
        for relation in relations:
            instances = get_m2m_reverse_instances(instance, relation)
            field = get_model_relation_by_instance(kwargs['model'], instance)
            changes = {field.name: {'changed': [instance.pk],
                                    'changed_to_string': six.text_type(instance)}}
            for k in instances:
                bulk.append(History.objects.add(
                        action=action,
                        changes=changes,
                        model=k,
                        commit=False,))

    if bulk:
        History.objects.bulk_create(bulk)
215577
def capture_update(self, *, update_fields=()):
        """"""
        return self.capture_update_from_model(self.table_name, self.record_id,
                                              update_fields=update_fields)
1029764
def update(self, **kwargs):
        '''  '''
        redis = type(self).get_redis()
        errors = ValidationErrors()

        for fieldname, field in self.proxy:
            if not field.fillable:
                continue

            given = kwargs.get(fieldname)

            if given is None:
                continue

            try:
                value = field.validate(kwargs.get(fieldname), redis)
            except BadField as e:
                errors.append(e)
                continue

            setattr(
                self,
                fieldname,
                value
            )

        if errors.has_errors():
            raise errors

        return self.save()
334904
def update(self, sha, force=False):
        
        data = {'sha': sha, 'force': force}
        json = self._json(self._patch(self._api, data=dumps(data)), 200)
        if json:
            self._update_(json)
            return True
        return False
988194
def update(self, **kwargs):
        
        super(ModelQuerySet, self).update(_changed=True, **kwargs)
644395
def update(self):
        
        if self._track_changes:
            data = self.to_api_data(restrict_keys=self._track_changes)
            if data:
                response = self.session.patch(self.build_url(''), data=data)
                if not response:
                    return False
                self._track_changes.clear()
        if self._font._track_changes:
            data = self._font.to_api_data(restrict_keys=self._font._track_changes)
            if data:
                response = self.session.patch(self.build_url(self._endpoints.get('font')), data=data)
                if not response:
                    return False
                self._font._track_changes.clear()
        if self._track_background_color:
            if self._background_color is None:
                url = self.build_url(self._endpoints.get('clear_fill'))
                response = self.session.post(url)
            else:
                data = {'color': self._background_color}
                url = self.build_url(self._endpoints.get('fill'))
                response = self.session.patch(url, data=data)
            if not response:
                return False
            self._track_background_color = False

        return True
76788
private List<AdvancedModelWrapper> updateReferencedModelsByEO(EngineeringObjectModelWrapper model) {
        List<AdvancedModelWrapper> updates = new ArrayList<AdvancedModelWrapper>();
        for (Field field : model.getForeignKeyFields()) {
            try {
                AdvancedModelWrapper result = performMerge(model, loadReferencedModel(model, field));
                if (result != null) {
                    updates.add(result);
                }
            } catch (EDBException e) {
                LOGGER.debug("Skipped referenced model for field {}, since it does not exist.", field, e);
            }
        }
        return updates;
    }
1152960
def update_item(cls, hash_key, range_key=None, attributes_to_set=None, attributes_to_add=None):
        """"""
        primary_key = cls._encode_key(hash_key, range_key)

        value_names = {}
        encoded_values = {}
        dynamizer = Dynamizer()

        set_expression = ''
        if attributes_to_set:
            for i, key in enumerate(attributes_to_set.keys()):
                value_name = ':s{0}'.format(i)
                value_names[key] = value_name
                encoded_values[value_name] = dynamizer.encode(attributes_to_set[key])

            set_expression = 'SET {0}'.format(
                ', '.join(
                    '{key}={value_name}'.format(key=key, value_name=value_names[key]) for key in attributes_to_set
                )
            )

        add_expression = ''
        if attributes_to_add:
            for i, key in enumerate(attributes_to_add.keys()):
                value_name = ':a{0}'.format(i)
                value_names[key] = value_name
                encoded_values[value_name] = dynamizer.encode(attributes_to_add[key])
            add_expression = 'ADD {0}'.format(
                ', '.join(
                    '{key} {value_name}'.format(key=key, value_name=value_names[key]) for key in attributes_to_add
                )
            )

        update_expression = ' '.join([set_expression, add_expression])

        cls._get_connection().update_item(
            cls.get_table_name(),
            primary_key,
            update_expression=update_expression, expression_attribute_values=encoded_values)
618800
def update
      params[:value].to_s.strip!
      @old_value = @translation_key.category.name
      respond_to do |format|
        if !params[:value].blank? && @translation_key.update_attribute(:name, params[:value])
          format.json { render json: {  new_value: @translation_key.name, new_category: @translation_key.category.name, old_category: @old_value, key_id: @translation_key.id } }
        else
          format.json { render json: @translation_key.errors, status: :unprocessable_entity }
        end
      end
    end
174162
def update_item(message_ids, opts={})
      opts = check_opts(UPDATE_ITEM_OPTS, opts)
      message_ids = message_ids.result if message_ids.is_a?(Folder::FindResult)

      updates = [*opts[:updates]].compact
      raise "no updates!" if updates.empty?
      r = with_error_check(self, :update_item_response, :response_messages, :update_item_response_message) do
        self.savon_client.request(:wsdl, "UpdateItem", 
                                  :ConflictResolution=>opts[:conflict_resolution],
                                  :MessageDisposition=>opts[:message_disposition]) do
          http.headers["SOAPAction"] = "\"#{SCHEMA_MESSAGES}/UpdateItem\"" # required by EWS 2007
          soap.namespaces["xmlns:t"]=SCHEMA_TYPES
          
          xml = Builder::XmlMarkup.new
          
          xml.wsdl :ItemChanges do
            message_ids.each do |mid|
              mid = mid.item_id if mid.is_a?(Item::Item)
              xml.t :ItemChange do
                xml << mid.to_xml(opts[:ignore_change_keys])
                xml.t :Updates do
                  updates.each do |update|
                    xml << update.to_xml
                  end
                end
              end
            end
          end
          
          soap.body = xml.target!
        end
      end
      r
    end