Saves the new value to the target object.
350497
def update_object(self, form, obj):
        
        field_name = form.cleaned_data['name']
        value = form.cleaned_data['value']
        setattr(obj, field_name, value)
        save_kwargs = {}
        if CAN_UPDATE_FIELDS:
            save_kwargs['update_fields'] = [field_name]
        obj.save(**save_kwargs)

        data = json.dumps({
            'status': 'success',
        })
        return HttpResponse(data, content_type="application/json")
888528
def _save(self, objects, old_pos, new_pos):
        """"""
        to_shift = objects.exclude(pk=self.pk) if self.pk else objects

        # If not set, insert at end.
        if self.sort_order is None:
            self._move_to_end(objects)

        # New insert.
        elif not self.pk and not old_pos:
            # Increment `sort_order` on objects with:
            #     sort_order > new_pos.
            to_shift = to_shift.filter(sort_order__gte=self.sort_order)
            self._update(to_shift)
            self.sort_order = new_pos

        # self.sort_order decreased.
        elif old_pos and new_pos < old_pos:
            self._move_to_end(objects)
            super(Orderable, self).save()
            # Increment `sort_order` on objects with:
            #     sort_order >= new_pos and sort_order < old_pos
            to_shift = to_shift.filter(sort_order__gte=new_pos, sort_order__lt=old_pos)
            self._update(to_shift)
            self.sort_order = new_pos

        # self.sort_order increased.
        elif old_pos and new_pos > old_pos:
            self._move_to_end(objects)
            super(Orderable, self).save()
            # Decrement sort_order on objects with:
            #     sort_order <= new_pos and sort_order > old_pos.
            to_shift = to_shift.filter(sort_order__lte=new_pos, sort_order__gt=old_pos)
            to_shift.update(sort_order=models.F('sort_order') - 1)
            self.sort_order = new_pos
1331954
def save(self, *args, **kwargs):
        
        # auto fill updated field with current time unless explicitly disabled
        auto_update = kwargs.get('auto_update', True)
        if auto_update:
            self.updated = now()

        # remove eventual auto_update
        if 'auto_update' in kwargs:
            kwargs.pop('auto_update')

        super(BaseDate, self).save(*args, **kwargs)
303298
def updateCurrentValue(self, value):
        
        try:
            method = getattr(self._targetObject, self._setter)
        except AttributeError:
            return
        
        try:
            method(unwrapVariant(value))
        except:
            return
202378
def save(self, obj, data, is_m2m=False):
        
        if not self.readonly:
            attrs = self.attribute.split('__')
            for attr in attrs[:-1]:
                obj = getattr(obj, attr, None)
            cleaned = self.clean(data)
            if cleaned is not None or self.saves_null_values:
                if not is_m2m:
                    setattr(obj, attrs[-1], cleaned)
                else:
                    getattr(obj, attrs[-1]).set(cleaned)
52352
def save(self):
        
        assert self.__class__ in conf.config._registry,\
            '%(class_name)s is not registered' % {
                'class_name': self.__class__.__name__
            }

        ConfigModel = apps.get_model('djconfig.Config')

        for field_name, value in self.cleaned_data.items():
            value = utils.serialize(
                value=value,
                field=self.fields.get(field_name, None))
            # TODO: use update_or_create
            count = (ConfigModel.objects
                .filter(key=field_name)
                .update(value=value))
            if not count:
                ConfigModel.objects.create(
                    key=field_name,
                    value=value)

        count = (ConfigModel.objects
            .filter(key='_updated_at')
            .update(value=str(timezone.now())))
        if not count:
            ConfigModel.objects.create(
                key='_updated_at',
                value=str(timezone.now()))

        conf.config._reload()
700046
public void savePersistentObject(PersistentObject object) {
        final String type = object.getClass().getSimpleName();
        LOG.trace("Trying to create a new " + type);
        dao.saveOrUpdate(object);
        LOG.info("Created the " + type + " with id " + object.getId());
    }
422023
public void update (T value)
    {
        // store our new current value
        _value = value;

        // notify our listeners; we snapshot our listeners before iterating to avoid problems if
        // listeners add or remove themselves while we're dispatching this notification
        for (Listener<T> listener : new ArrayList<Listener<T>>(_listeners)) {
            listener.valueChanged(value);
        }
    }
1162214
def put(self, key, value):
    '''
    '''

    value = self.serializedValue(value)
    self.child_datastore.put(key, value)
1049224
def save_object(fname, obj):
    """"""

    fd = gzip.open(fname, "wb")
    six.moves.cPickle.dump(obj, fd)
    fd.close()
283947
function (newValue) {
		var oldValue = this._value;
		if (oldValue !== newValue) {
			this._value = newValue;
			this.trigger(EVENT_CHANGE, this, newValue, oldValue);
		}
	}
742402
def save(self):
        

        if self.object_id:
            # update event
            if not self._track_changes:
                return True  # there's nothing to update
            url = self.build_url(
                self._endpoints.get('event').format(id=self.object_id))
            method = self.con.patch
            data = self.to_api_data(restrict_keys=self._track_changes)
        else:
            # new event
            if self.calendar_id:
                url = self.build_url(
                    self._endpoints.get('event_calendar').format(
                        id=self.calendar_id))
            else:
                url = self.build_url(self._endpoints.get('event_default'))
            method = self.con.post
            data = self.to_api_data()

        response = method(url, data=data)
        if not response:
            return False

        self._track_changes.clear()  # clear the tracked changes

        if not self.object_id:
            # new event
            event = response.json()

            self.object_id = event.get(self._cc('id'), None)

            self.__created = event.get(self._cc('createdDateTime'), None)
            self.__modified = event.get(self._cc('lastModifiedDateTime'), None)

            self.__created = parse(self.__created).astimezone(
                self.protocol.timezone) if self.__created else None
            self.__modified = parse(self.__modified).astimezone(
                self.protocol.timezone) if self.__modified else None
        else:
            self.__modified = self.protocol.timezone.localize(dt.datetime.now())

        return True
104313
def on_value_change(self, picker, old, new):
        
        d = self.declaration
        with self.widget.setValue.suppressed():
            d.value = new
569441
public void saveValue()
    {
        BaseField field = this.getOwner();
        RecordOwner recordOwner = field.getRecord().getRecordOwner();
        if (recordOwner instanceof ComponentParent)
            this.saveValue((ComponentParent)recordOwner);
    }
544924
def save(self, key, kw):
        
        if key not in self:
            obj = hdf5.LiteralAttrs()
        else:
            obj = self[key]
        vars(obj).update(kw)
        self[key] = obj
        self.flush()
205138
def save!
      object = self.class.name.split("::").last.downcase
      data = {}

      self.class.accessor_properties.each do |property|
        data[property] = instance_variable_get "@#{property}"
      end

      API.send("update_#{object}", @id, data)
    end
848588
def pref_update(self, key, new_val):
        
        print('Update and save pref from: %s=%r, to: %s=%r' %
              (key, six.text_type(self[key]), key, six.text_type(new_val)))
        self.__setattr__(key, new_val)
        return self.save()