Calls Model._modifyInternal after loading the database.
778171
def modify(self, *, sort=None, purge=False, done=None):
        """"""
        return self._modifyInternal(sort=sort, purge=purge, done=done)
736229
protected function _modify()
    {
        $this->_table->alter(
            'MODIFY ' .
            $this->_database->prepareIdentifier($this->_name) .
            ' ' .
            $this->getDefinition()
        );
    }
1050619
def reload(self):
        
        new_model = self.collection.get(self.id)
        self.attrs = new_model.attrs
996843
def after_object(eng, objects, obj):
        """"""
        # We save each object once it is fully run through
        super(InvenioProcessingFactory, InvenioProcessingFactory)\
            .after_object(eng, objects, obj)
        obj.save(
            status=obj.known_statuses.COMPLETED,
            id_workflow=eng.model.uuid
        )
        db.session.commit()
775317
public function afterImport()
    {
        $obj = Craft::$app->globals;
        $refObject = new \ReflectionObject($obj);
        if ($refObject->hasProperty('_allGlobalSets')) {
            $refProperty1 = $refObject->getProperty('_allGlobalSets');
            $refProperty1->setAccessible(true);
            $refProperty1->setValue($obj, null);
        }
    }
1109659
def update(self, *objs):
        
        keys = self.keys()
        new_keys = get_objs_columns(objs, self.realfieldb)

        modified = False
        for v in new_keys:
            if v in keys:    #the id has been existed, so don't insert new record
                keys.remove(v)
            else:
                d = {self.fielda:self.valuea, self.fieldb:v}
                if self.before_save:
                    self.before_save(d)
                if self.through_model:
                    obj = self.through_model(**d)
                    obj.save()
                else:
                    self.do_(self.table.insert().values(**d))
                modified = True
                
        if keys: #if there are still keys, so delete them
            self.clear(*keys)
            modified = True
        
        #cache [] to _STORED_attr_name
        setattr(self.instance, self.store_key, new_keys)
        
        return modified
375466
def _after_handler(self, iid, callback, args):
        """"""
        self._after_id = None
        self.update_state(iid, "normal")
        self.call_callbacks(iid, callback, args)
1092438
function() {
      var self = this;
      // Start by removing all old bindings and falling back to the initialized binding contents
      this.bindings = _.extend({}, this._bindings);

      // Stickit model two-way bindings
      _.each(this.$('[data-model]'), function(element) {
        var attr = $(element).data('model'),
            options = self.__getFieldOptions(attr),
            fieldBinding = self.__generateModelFieldBinding(attr, options);

        //add select options
        if ($(element).is('select')) {
          fieldBinding.selectOptions = self.__generateSelectOptions(element, options);
        }

        self.bindings['[data-model="' + attr + '"]'] = fieldBinding;
      });
    }
888297
async def update(self, db=None, data=None):
        '''
        
        '''
        db = db or self.db
        if data:  # update model explicitely with a new data structure
            # merge the current model's data with the new data
            self.import_data(data)
            # prepare data for database update
            data = self.prepare_data()
            # data = {x: ndata[x] for x in ndata if x in data or x == self.primary_key}
        else:
            data = self.export_data(native=True)

        if self.primary_key not in data or data[self.primary_key] is None:
            raise Exception('Missing object primary key')
        query = {self.primary_key: self.pk}
        for i in self.connection_retries():
            try:
                result = await db[self.get_collection_name()].find_one_and_replace(
                    filter=query,
                    replacement=data,
                    return_document=ReturnDocument.AFTER
                )
                if result:
                    updated_obj = self.create_model(result)
                    updated_obj._db = db
                    # emit post save
                    asyncio.ensure_future(post_save.send(
                        sender=self.__class__,
                        db=db,
                        instance=updated_obj,
                        created=False)
                    )
                    return updated_obj

                return None
            except ConnectionFailure as ex:
                exceed = await self.check_reconnect_tries_and_wait(i, 'update')
                if exceed:
                    raise ex
718860
public function afterRegistry()
    {
        parent::afterRegistry();

        $this->addColumn($this->util->getTokenData()->getStatusExpression(), 'status');

        if (! $this->request instanceof \Zend_Controller_Request_Abstract) {
            $this->request = \Zend_Controller_Front::getInstance()->getRequest();
        }
    }
1115797
def update_indexes_after(start_index)
      size = @templates.size
      if size > 0
        start_index.upto(size - 1) do |index|
          @templates[index].context.locals[:_index=].call(index)
        end
      end
    end
686441
protected function executeInternal()
    {
        $formRuntime = $this->finisherContext->getFormRuntime();
        $formValues = json_encode($formRuntime->getFormState()->getFormValues());
        $formIdentifier = $formRuntime->getFormDefinition()->getIdentifier();
        $accountIdentifier = $this->getAccountIdentifier();
        $formData = new FormData($formIdentifier, $accountIdentifier, $formValues);
        foreach ($this->defaultOptions as $option => $value) {
            $value = $this->parseOption($option);
            if ($value === false) {
                continue;
            }
            switch ($option) {
                case 'db':
                    $this->formDataRepository->add($formData);
                    break;
                case 'elasticSearch':
                    $properties = array();
                    $elements = $formRuntime->getFormDefinition()->getRenderablesRecursively();
                    foreach ($elements as $element) {
                        if (!$element instanceof FormElementInterface) {
                            continue;
                        }
                        $properties[$element->getIdentifier()] = $element->getProperties();
                    }
                    $this->elasticSearchService->index($formData, $properties);
            }
        }
    }
1339820
function updateNestedModels() {
  nestedRegistry.models = [];
  _.each(nestedRegistry.views, function(view) {
    var data = (view.obj.model || view.obj.collection);
    if (data) {
      nestedRegistry.models.push(flatRegistry.models[data.getDebugName()]);
    }
  });
}
818820
def update(self, **kwargs):
        """"""
        self.inflate()
        for model in self._models:
            model.update(**kwargs)
        return self
758309
def init(cls, conn_string=None):
        """"""
        if conn_string:
            _update_meta(conn_string)
            # We initialize the engine within the models module because models'
            # schema can depend on which data types are supported by the engine
            Meta.Session = new_sessionmaker()
            Meta.engine = Meta.Session.kw["bind"]
            logger.info(
                f"Connecting user:{Meta.DBUSER} "
                f"to {Meta.DBHOST}:{Meta.DBPORT}/{Meta.DBNAME}"
            )
            Meta._init_db()

        if not Meta.log_path:
            init_logging()

        return cls
1067591
def modify(name, old_value, new_value)
      @attributes[name] = new_value
      if @modifications && (old_value != new_value)
        original = @modifications[name].first if @modifications[name]
        @modifications[name] = [ (original || old_value), new_value ]
      end
    end
444076
def modify_init(uid, data_dic):
        '''
        
        '''
        postinfo = MPost.get_by_uid(uid)
        entry = TabPost.update(
            time_update=tools.timestamp(),
            date=datetime.now(),
            kind=data_dic['kind'] if 'kind' in data_dic else postinfo.kind,
            keywords=data_dic['keywords'] if 'keywords' in data_dic else postinfo.keywords,
        ).where(TabPost.uid == uid)
        entry.execute()
        return uid