Internal method, prepare the list model object
347782
protected function createModel($item)
    {
        if (!isset($item->class) || !strlen($item->class)) {
            throw new ApplicationException(Lang::get('system::lang.settings.missing_model'));
        }

        $class = $item->class;
        return $class::instance();
    }
919341
def populate_model(model_or_inst, excludes=None, only=None):
    
    inst = model_or_inst if _is_inst(model_or_inst) else model_or_inst()

    parser = make_request_parser(model_or_inst, excludes, only, for_populate=True)
    req_args = parser.parse_args()

    for key, value in req_args.items():
        setattr(inst, key, value)

    return inst
1070116
def prepare(base_path='data',
            serialize=json.dumps,
            deserialize=json.loads,
            file_ext='json'):
    """"""
    global _basepath, _deserialize, _serialize, _ext
    _basepath = base_path
    assert callable(serialize)
    assert callable(deserialize)
    _serialize = serialize
    _deserialize = deserialize
    _ext = file_ext
    _logger.debug('preparing with base path %s and file ext %s',
        _basepath, _ext)
    assert len(_db)
    for collection in _db.keys():
        c_path = collection_path(collection)
        os.makedirs(c_path, exist_ok=True)
        _logger.info('collection "%s": %d objects',
            collection, object_count(collection))
958376
protected void fillList() {

        try {
            getList().setContent(getListItems());
            // initialize detail columns
            Iterator<CmsListItemDetails> itDetails = getList().getMetadata().getItemDetailDefinitions().iterator();
            while (itDetails.hasNext()) {
                initializeDetail(itDetails.next().getId());
            }
        } catch (Exception e) {
            throw new CmsRuntimeException(
                Messages.get().container(Messages.ERR_LIST_FILL_1, getList().getName().key(getLocale()), null),
                e);
        }
    }
1057189
def _serialize_list(cls, list_):
        

        list_serialized = []

        for item in list_:
            item_serialized = cls.serialize(item)
            list_serialized.append(item_serialized)

        return list_serialized
888774
protected function preparePrep(){
        $this->prepList = array();
        $this->invalidList = array();
        $this->rewind();
        if (array_key_exists('SellerSKUList.Id.1',$this->options)){
            $this->options['Action'] = 'GetPrepInstructionsForSKU';
            $this->resetASINs();
        } else if (array_key_exists('ASINList.Id.1',$this->options)){
            $this->options['Action'] = 'GetPrepInstructionsForASIN';
            $this->resetSKUs();
        }
    }
960281
protected function modelToYamlArray()
    {
        $fileColumns = [];

        foreach ($this->columns as $column) {
            if (!isset($column['field'])) {
                throw new ApplicationException('Cannot save the list - the column field name should not be empty.');
            }

            $columnName = $column['field'];
            unset($column['field']);

            if (array_key_exists('id', $column)) {
                unset($column['id']);
            }

            $column = $this->preprocessColumnDataBeforeSave($column);

            $fileColumns[$columnName]  = $column;
        }

        return [
            'columns'=>$fileColumns
        ];
    }
937527
def serialize(self, value, entity, request):
        
        value = super(ListField, self).serialize(value, entity, request)
        if value is None:
            return
        ret = []
        for v in value:
            ret.append(self.itemspec.serialize(v, entity, request))
        return ret
994569
def list_model_columns(obj)
      items = obj.class.columns.map{ |col| info_pair(col.name, obj[col.name]) }
      content_tag(:ul, convert_to_list_items(items), :class => "model_columns")
    end
628473
protected function prepareListPage(array &$list)
    {
        foreach ($list as &$item) {
            $this->setItemUrlEntity($item, $this->store, 'page');
        }
    }
996362
protected function prepareList()
    {
        $displayCount = 0;

        foreach ($this->items as &$item) {
            $displayCount++;
            // @todo this should not ignore the items current display state
            // - Should check the current display state and try to keep it if possible
            if ($displayCount > $this->displayCount) {
                $item->setDisplay(0);
            } else {
                $item->setDisplay(1);
            }
        }
    }
266570
def serialize_list(self, data):
        
        if data is None:
            return ''

        # Check for a ``Data``-like object. We should assume ``True`` (all
        # data gets prepared) unless it's explicitly marked as not.
        if not getattr(data, 'should_prepare', True):
            prepped_data = data.value
        else:
            prepped_data = [self.prepare(item) for item in data]

        final_data = self.wrap_list_response(prepped_data)
        return self.serializer.serialize(final_data)
210625
def prep_for_deserialize(model, record, using, init_list=None):  # pylint:disable=unused-argument
    
    # TODO the parameter 'using' is not currently important.
    attribs = record.pop('attributes')  # NOQA pylint:disable=unused-variable

    mod = model.__module__.split('.')
    if hasattr(model._meta, 'app_label'):
        app_label = getattr(model._meta, 'app_label')
    elif mod[-1] == 'models':
        app_label = mod[-2]
    else:
        raise ImproperlyConfigured("Can't discover the app_label for %s, you must specify it via model meta options.")

    if len(record.keys()) == 1 and model._meta.db_table in record:
        # this is for objects with ManyToManyField and OneToOneField
        while len(record) == 1:
            record = list(record.values())[0]
            if record is None:
                return None

    fields = prep_for_deserialize_inner(model, record, init_list=init_list)

    if init_list and set(init_list).difference(fields).difference([SF_PK]):
        raise DatabaseError("Not found some expected fields")

    return dict(
        model='.'.join([app_label, model.__name__]),
        pk=record.pop('Id'),
        fields=fields,
    )
670682
def prepare(self, data):
        
        result = []

        for item in self.get_inner_data(data):
            result.append(self.preparer.prepare(item))

        return result
721115
private void setModellistByModel(ModelListForm listForm, PageIterator pageIterator, HttpServletRequest request) {
		Collection c = null;
		try {
			listForm.setAllCount(pageIterator.getAllCount());
			if (pageIterator.getCount() != 0)
				listForm.setCount(pageIterator.getCount());
			c = new ArrayList(pageIterator.getSize());
			while (pageIterator.hasNext()) {
				Object o = pageIterator.next();
				if (o != null)
					c.add(o);
			}
			Debug.logVerbose("[JdonFramework] listForm 's property: getList size is " + c.size(), module);
			pageIterator.reset();
		} catch (Exception e) {
			Debug.logError(" setModellistByModel error " + e, module);
			c = new ArrayList();
		}
		listForm.setList(c);
	}
783168
protected Object processFetchedHistoryModelList(final List<Version<MODEL>> list,
                                                    final MODEL_ID id) throws Exception {
        return list;
    }
939659
function ()
		{
			for (c in this.c)
			{
				if (this.c[c].build && this.c[c].build.extend && this.c[c].build.extend.indexOf('wnActiveRecord')!=-1)
				{
					this.prepareModel(c);
				}
			}
		}