Store the data we'll need to make the postback from the request object.
183822
def initialize(self, request):
        """"""
        if request.method == 'GET':
            # PDT only - this data is currently unused
            self.query = request.META.get('QUERY_STRING', '')
        elif request.method == 'POST':
            # The following works if paypal sends an ASCII bytestring, which it does.
            self.query = request.body.decode('ascii')
        self.ipaddress = request.META.get('REMOTE_ADDR', '')
678673
def post(self, request, *args, **kwargs):
        

        # Prepare base
        if 'pk' in kwargs:
            self.object = self.get_object()
        else:
            self.object = None
        form_class = self.get_form_class()

        # Get prefix
        if 'field_prefix' in form_class.Meta.__dict__:
            # Get name from the form
            field_prefix = form_class.Meta.field_prefix
            # Initialize list of fields
        else:
            # Get name from the class
            field_prefix = str(form_class).split("'")[1].split(".")[-1]
        self.field_prefix = field_prefix

        # Build the form
        form = self.get_form(form_class)

        # Find groups
        if 'groups' in dir(self):
            # Save groups
            groups = self.groups
            # Redefine groups inside the form
            form.__groups__ = lambda: groups
            # Initialize list of fields
            fields = []
        else:
            groups = None

        # Add special prefix support to properly support form independency
        form.add_prefix = lambda fields_name, field_prefix=field_prefix: "%s_%s" % (field_prefix, fields_name)

        # Check validation
        valid = form.is_valid()
        if (not valid) and ('non_field_errors' in dir(self)):
            errors = [element[5] for element in list(self.non_field_errors())[:-1]]
        elif form.errors.as_data():
            errors = []
            for element in form.errors.as_data():
                for err in form.errors.as_data()[element][0]:
                    errors.append(err)
        else:
            errors = []

        # For every extra form
        temp_forms = []
        position_form_default = 0
        for (formelement, linkerfield, modelfilter) in self.forms:
            if formelement is None:
                formobj = form
                position_form_default = len(temp_forms)
            else:
                # Locate linked element
                if self.object:
                    related_name = formelement._meta.model._meta.get_field(linkerfield).related_query_name()
                    queryset = getattr(self.object, related_name)
                    if modelfilter:
                        queryset = queryset.filter(eval("Q(%s)" % (modelfilter)))
                    get_method = getattr(queryset, 'get', None)
                    if get_method:
                        instance = queryset.get()
                    else:
                        instance = queryset
                else:
                    instance = None

                # Get prefix
                if 'field_prefix' in formelement.Meta.__dict__:
                    # Get name from the form
                    field_prefix = formelement.Meta.field_prefix
                else:
                    # Get name from the class
                    field_prefix = str(formelement).split("'")[1].split(".")[-1]
                self.field_prefix = field_prefix

                # Prepare form
                formobj = formelement(instance=instance, data=self.request.POST)
                formobj.form_name = form.form_name

                # Excluded fields
                if 'exclude' not in formobj.Meta.__dict__:
                    formobj.Meta.exclude = [linkerfield]
                elif linkerfield not in formobj.Meta.exclude:
                    formobj.Meta.exclude.append(linkerfield)
                if linkerfield in formobj.fields:
                    del(formobj.fields[linkerfield])

                # Link it to the main model
                formobj.add_prefix = lambda fields_name, field_prefix=field_prefix: "%s_%s" % (field_prefix, fields_name)

                # Validate
                valid *= formobj.is_valid()

                # append error
                if not formobj.is_valid() and ('non_field_errors' in dir(formobj)):
                    errors += [element[5] for element in list(formobj.non_field_errors())[:-1]]

            # Save fields to the list
            if groups:
                for field in formobj:
                    # raise Exception (field.__dict__)
                    if 'unblock_t2ime' in field.html_name:
                        raise Exception(field.field.__dict__)
                    fields.append(field)

            # Add a new form
            temp_forms.append((formobj, linkerfield))

        # execute validation specified
        validate_forms = None
        if valid and ("validate" in dir(self)):
            validate_forms = [tform[0] for tform in temp_forms]
            errors = self.validate(*validate_forms)
            # valid = len(errors) == 0
            valid = False
            if errors is None or len(errors) == 0:
                valid = True

        # Remember list of fields
        if groups:
            form.list_fields = fields
            forms = []
        else:
            if validate_forms:
                forms = validate_forms
            else:
                forms = [tform[0] for tform in temp_forms]

        if position_form_default == 0:
            open_tabs = 1
        else:
            open_tabs = 0

        # Check validation result
        if valid:
            # Everything is OK, call valid
            return self.form_valid(form, temp_forms)
        else:
            # Something went wrong, attach error and call invalid
            form.list_errors = errors
            return self.form_invalid(form, forms, open_tabs, position_form_default)
332588
protected function storeData()
    {
        if ($this->currentCellIsDirty && !empty($this->currentObjectID)) {
            $this->currentObject->detach();

            fseek($this->fileHandle, 0, SEEK_END);

            $this->cellCache[$this->currentObjectID] = array(
                'ptr' => ftell($this->fileHandle),
                'sz'  => fwrite($this->fileHandle, serialize($this->currentObject))
            );
            $this->currentCellIsDirty = false;
        }
        $this->currentObjectID = $this->currentObject = null;
    }
736407
def save(self):
        
        if self.path.is_collection:
            self.session.post_json(self.href,
                                   {self.type: dict(self.data)},
                                   cls=ResourceEncoder)
        else:
            self.session.put_json(self.href,
                                  {self.type: dict(self.data)},
                                  cls=ResourceEncoder)
        return self.fetch(exclude_children=True, exclude_back_refs=True)
623345
def save(self, request, resource=None, **kwargs):
        """"""
        resources = resource if isinstance(resource, list) else [resource]
        for obj in resources:
            obj.save()
        return resource
523083
function handlePostRequest(request) {
  const className = request.className;
  const collection = getCollection(className);

  let newObject;
  return runHook(className, 'beforeSave', request.data).then(result => {
    const changedKeys = getChangedKeys(request.data, result);

    const newId = crypto.newObjectId();
    const now = new Date();

    const ops = extractOps(result);

    newObject = Object.assign(
      result,
      { objectId: newId, createdAt: now, updatedAt: now }
    );

    applyOps(newObject, ops, className);
    const toOmit = ['updatedAt'].concat(Array.from(getMask(className)));
    const toPick = Object.keys(ops).concat(changedKeys);

    collection[newId] = newObject;

    const response = Object.assign(
      _.cloneDeep(_.omit(_.pick(result, toPick), toOmit)),
      { objectId: newId, createdAt: result.createdAt.toJSON() }
    );

    return Parse.Promise.as(respond(201, response));
  }).then((result) => {
    runHook(className, 'afterSave', newObject);
    return result;
  });
}
696657
def save(self):
        

        data = {
            'waitForSync': self.waitForSync,
            'journalSize': self.journalSize,
        }

        self.resource(self.name).properties.put(data)
1058216
def save():
    '''
    '''
    if request.method == 'POST':
        exp_id = session.get('exp_id')
        app.logger.debug('Saving data for %s' %exp_id)

        fields = get_post_fields(request)
        result_file = app.save_data(session=session, content=fields, exp_id=exp_id)

        experiments = app.finish_experiment(session, exp_id)
        app.logger.info('Finished %s, %s remaining.' % (exp_id, len(experiments)))

        # Note, this doesn't seem to be enough to trigger ajax success
        return json.dumps({'success':True}), 200, {'ContentType':'application/json'} 
    return json.dumps({'success':False}), 403, {'ContentType':'application/json'}
34795
protected function _storeData() {
		if ($this->_currentCellIsDirty) {
			$this->_currentObject->detach();

			$this->_cellCache[$this->_currentObjectID] = igbinary_serialize($this->_currentObject);
			$this->_currentCellIsDirty = false;
		}
		$this->_currentObjectID = $this->_currentObject = null;
	}
150032
private function storeValues()
    {
        $this->debug->groupCollapsed(__METHOD__);
        // if (!$this->status['keyVerified']) {
        if (!$this->status['submitted']) {
            // $this->debug->warn('not submitted');
            $this->debug->groupEnd();
            return;
        }
        if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
            $this->debug->warn('POST method');
            if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] > Str::getBytes(\ini_get('post_max_size'), true)) {
                $this->debug->warn('post_max_size exceeded');
                $this->alerts->add('Your upload has exceeded the '.Str::getBytes(\ini_get('post_max_size')).' limit');
                $this->status['postMaxExceeded'] = true;
            }
            $values = $_POST;
            foreach ($_FILES as $k => $file) {
                if ($file['error'] === UPLOAD_ERR_NO_FILE) {
                    continue;
                }
                if ($file['error'] === UPLOAD_ERR_OK) {
                    // by calling move_uploaded_file, we prevent its automatic deletion
                    \move_uploaded_file($file['tmp_name'], $file['tmp_name']);
                }
                $values[$k] = $file;
                /*
                errors:
                    UPLOAD_ERR_OK => 'There is no error, the file uploaded with success',
                    UPLOAD_ERR_INI_SIZE => 'The uploaded file exceeds the upload_max_filesize directive in php.ini ('.\ini_get('upload_max_filesize').')',
                    UPLOAD_ERR_FORM_SIZE => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
                    UPLOAD_ERR_PARTIAL => 'The uploaded file was only partially uploaded',
                    UPLOAD_ERR_NO_FILE => 'No file was uploaded',
                    UPLOAD_ERR_NO_TMP_DIR => 'Missing a temporary folder',
                    UPLOAD_ERR_CANT_WRITE => 'Failed to write file to disk.',
                    UPLOAD_ERR_EXTENSION => 'A PHP extension stopped the file upload.',
                */
            }
            $this->status['submitted'] = true;
            $this->persist->set('submitted', true);
            $this->persist->set('currentPage.values', $values);
        } elseif (\strtolower($this->cfg['attribs']['method']) == 'get') {
            $this->debug->warn('storing GET vals');
            $this->persist->set('currentPage.values', $_GET);
        }
        $this->debug->groupEnd();
    }
905530
def save(self):
        
        resp = self._client.put(type(self).api_endpoint, model=self,
            data=self._serialize())

        if 'error' in resp:
            return False
        return True
24288
def _handle_get(self, request):
        # type: (Get) -> CallbackResponses
        """"""
        data = self._block

        for i, endpoint in enumerate(request.path[1:]):
            try:
                data = data[endpoint]
            except KeyError:
                if hasattr(data, "typeid"):
                    typ = data.typeid
                else:
                    typ = type(data)
                raise UnexpectedError(
                    "Object %s of type %r has no attribute %r" % (
                        request.path[:i+1], typ, endpoint))
        # Important to serialize now with the lock so we get a consistent set
        serialized = serialize_object(data)
        ret = [request.return_response(serialized)]
        return ret
958304
def StoreResults(self, responses):
    """"""
    client_id = responses.request.client_id

    if responses.success:
      logging.info("Client %s has a file %s.", client_id, self.args.filename)
    else:
      logging.info("Client %s has no file %s.", client_id, self.args.filename)

    self.MarkClientDone(client_id)
306998
def to_postdata(self):
        """"""
        items = []
        for k, v in sorted(self.items()):  # predictable for testing
            items.append((k.encode('utf-8'), to_utf8_optional_iterator(v)))

        # tell urlencode to deal with sequence values and map them correctly
        # to resulting querystring. for example self["k"] = ["v1", "v2"] will
        # result in 'k=v1&k=v2' and not k=%5B%27v1%27%2C+%27v2%27%5D
        return urlencode(items, True).replace('+', '%20').encode('ascii')
658621
private void addPostParams(final Request request) {
        if (attributes != null) {
            request.addPostParam("Attributes", attributes);
        }

        if (dateCreated != null) {
            request.addPostParam("DateCreated", dateCreated.toString());
        }

        if (dateUpdated != null) {
            request.addPostParam("DateUpdated", dateUpdated.toString());
        }
    }
441761
function save(callback) {
            var model, request;

            model = this;

            this.constructor.dispatch('beforeSave', {
                data : {
                    model : this
                }
            });
            this.dispatch('beforeSave');

            this.isValid(function (isValid) {
                if (isValid) {
                    if (model.hasOwnProperty('id') && model.id !== '') {
                        request = {
                            action : 'update',
                            data : model,
                            model : model.constructor
                        };
                        model.constructor.storage.update(request, function updateCallback(data) {
                            model.constructor.dispatch('afterSave', {
                                data : {
                                    model : model
                                }
                            });

                            model.dispatch('afterSave');
                            if (callback) {
                                callback(data);
                            }
                        });
                    }
                    else {
                        request = {
                            action : 'create',
                            data : model,
                            model : model.constructor
                        };
                        model.constructor.storage.create(request, function createCallback(data) {
                            model.constructor.dispatch('afterSave', {
                                data : {
                                    model : model
                                }
                            });

                            model.dispatch('afterSave');
                            if (callback) {
                                callback(data);
                            }
                        });
                    }
                } else {
                    if (callback) {
                        callback(data);
                    }
                }
            });

        }
305936
public function store()
    {
        if ($this->id !== null) {
            $method = 'PUT';
            $path = '/' . $this->id;
        } else {
            $method = 'POST';
            $path = '';
        }
        $response = $this->request($method, $path, [], json_encode($this->data));
        $treatedContent = $response->getTreatedContent();

        $this->id = $treatedContent['_id'];
        $this->version = $treatedContent['_version'];
        $this->dirty = false;
    }