Fetch the model from the server. If the server's representation of the model differs from its current attributes, they will be overriden, triggering a `"change"` event.
199733
function(options) {
      options = options ? _.clone(options) : {};
      if (options.parse === void 0) options.parse = true;
      var model = this;
      var success = options.success;
      options.success = function(resp, status, xhr) {
        if (!model.set(model.parse(resp), options)) return false;
        if (success) success(model, resp, options);
      };
      return this.sync('read', this, options);
    }
879465
def get_model_type(self):
        
        if self.model_type is None:
            raise ImproperlyConfigured(
                "%s requires either a definition of "
                "'model_type' or an implementation of 'get_model_type()'" %
                self.__class__.__name__)
        return self.model_type
285062
def model_getattr():
    

    def model_getattr(_value, context, **_params):
        value = getattr(context["model"], context["key"])
        return _attr(value)

    return model_getattr
1140964
def changelist_view(self, request, extra_context=None):
        
        if self.model is not self.concrete_model:
            return HttpResponseRedirect(
                admin_url(self.concrete_model, "changelist"))

        extra_context = extra_context or {}
        extra_context["content_models"] = self.get_content_models()

        return super(ContentTypedAdmin, self).changelist_view(
            request, extra_context)
791604
def update_model(self, model, *, include_keys=None):
    
    id_constraints = get_model_id_constraints(model)

    if include_keys is None:
      include_keys = set(
        model.attrs.keys()).difference(model.exclude_keys_sql).difference(id_constraints.keys())

    # If include_keys was not null but was empty
    if not include_keys:
      return model

    values = model.to_dict(include_keys=include_keys)
    returnings = []

    _, updated_ts = model.timestamps if model.timestamps else (None, None)

    if updated_ts and updated_ts not in values:
      values[updated_ts] = utc_now() if self.core.supports_timezones else local_now()
      returnings.append(updated_ts)

    returning = ", ".join(returnings)
    cr = self.update(model.table_name, values, id_constraints, returning=returning)

    if returning and self.core.supports_returning_syntax:
      rec = cr.fetchone()
      for idx, attr_name in enumerate(returnings):
        setattr(model, attr_name, rec[idx])

    return model
570547
function() {
    var model = this._model;
    var arrayTransform = function(result) { // jscs:ignore jsDoc
      return result.rows;
    };
    var modelTransform = function(rows) { // jscs:ignore jsDoc
      return rows.map(model.load.bind(model));
    };

    var dup = this._dup()
      .transform(arrayTransform)
      .transform(modelTransform);

    dup._arrayTransform = arrayTransform;
    dup._modelTransform = modelTransform;

    return dup;
  }
1023661
function(attrs, options) {

            // begin lazo specific overrides
            var modelName = null;
            if (this.modelName) {
                if (_.isFunction(this.modelName)) {
                    modelName = this.modelName(attrs, options);
                }
                else {
                    modelName = this.modelName;
                }
            }
            // end lazo specific overrides

            if (attrs instanceof Backbone.Model) {
                if (!attrs.collection) attrs.collection = this;
                if (!attrs.name && modelName) attrs.name = modelName; // lazo specific
                return attrs;
            }
            options || (options = {});
            options.collection = this;

            // begin lazo specific overrides
            if (modelName) {
                options.name = modelName;
            }

            options.ctx = this.ctx;
            // end lazo specific overrides

            var model = new this.model(attrs, options);
            if (!model._validate(attrs, options)) {
                this.trigger('invalid', this, attrs, options);
                return false;
            }
            return model;
        }
1331204
public function retrieveModel()
    {
        if ($this->model->persisted()) {
            return;
        }

        $modelClass = $this->modelClass;
        $this->model = $modelClass::find($this->modelId);

        if (!$this->model) {
            throw $this->modelNotFoundError();
        }
    }
937100
function(changedModel, options) {

        // Don't update unless the model is different
        var newModel = model.syncMonitor.get('model');
        if (_.isEqual(JSON.parse(JSON.stringify(model)), JSON.parse(JSON.stringify(newModel)))) {
          log.info('monitorListener.noChanges', t.className, newModel);
          return;
        }

        // Disconnect if the model was deleted or the ID isn't the same
        var isDeleted = (_.size(newModel) === 0);
        if (isDeleted || newModel.id !== modelId)  {
          log.info('modelListener.deleted', t.className, newModel);
          disconnectListeners();
        }

        // Forward changes to the model (including server-side delete)
        var newOpts = {isSyncChanging:true};
        if (isDeleted) {
          log.info('modelListener.deleting', t.className, newModel);
          model.clear(newOpts);
        } else {
          // Make sure the model is set to exactly the new contents (vs. override)
          log.info('modelListener.setting', t.className, newModel);
          model.clear({silent:true});
          model.set(newModel, newOpts);
        }
      }
864606
def fetch(self, endpoint, data = None):
        
        payload = {
            "lastServerChangeId": "-1",
            "csrf": self.__csrf,
            "apiClient": "WEB"
        }
        if data is not None:
            payload.update(data)

        return self.post(endpoint, payload)
1203058
def dispatch(self, receiver):
        ''' 

        '''
        super(ModelChangedEvent, self).dispatch(receiver)
        if hasattr(receiver, '_document_model_changed'):
            receiver._document_model_changed(self)
854139
def get(self, model, property_name):
        
        if type(model) is dict:
            if property_name not in model:
                return None
            else:
                return model[property_name]
        elif hasattr(model, 'get_' + property_name):
            getter = getattr(model, 'get_' + property_name)
            return getter()
        else:
            try:
                return getattr(model, property_name)
            except AttributeError:
                return None
1050619
def reload(self):
        
        new_model = self.collection.get(self.id)
        self.attrs = new_model.attrs
1356921
function(options) {
      options = options ? _.clone(options) : {};
      if (options.parse === void 0) options.parse = true;
      var model = this;
      var success = options.success;
      options.success = function(resp) {
        if (!model.set(model.parse(resp, options), options)) return false;
        if (success) success(model, resp, options);
        model.trigger('sync', model, resp, options);
      };
      wrapError(this, options);
      return this.sync('read', this, options);
    }
123494
def resolve_model(self, model):
        '''
        
        '''
        if not model:
            raise ValueError('Unsupported model specifications')
        if isinstance(model, basestring):
            classname = model
        elif isinstance(model, dict) and 'class' in model:
            classname = model['class']
        else:
            raise ValueError('Unsupported model specifications')

        try:
            return get_document(classname)
        except self.NotRegistered:
            message = 'Model "{0}" does not exist'.format(classname)
            raise ValueError(message)
1078814
private ModelDef getOverrideModel(ModelDef model,
			ModelMetaData explicitMeta2) {
		if(explicitMeta2 == null){
			return model;
		}
		List<ModelDef> explicitList = explicitMeta2.getModelDefinitionList();
		for(ModelDef explicitModel : explicitList){
			if(explicitModel.getModelName().equals(model.getModelName())){
				return explicitModel;
			}
		}
		return model;
	}
265328
def data_changed(self, change):
        
        index = self.index
        if index:
            self.view.model.dataChanged.emit(index, index)