Update a Product with new information
194036
def update_product(product_id, **kwargs):
    
    content = update_product_raw(product_id, **kwargs)
    if content:
        return utils.format_json(content)
476376
def OnUpdate(self, event):
        """"""

        if wx.ID_UNDO in self.id2menuitem:
            undo_item = self.id2menuitem[wx.ID_UNDO]
            undo_item.Enable(undo.stack().canundo())

        if wx.ID_REDO in self.id2menuitem:
            redo_item = self.id2menuitem[wx.ID_REDO]
            redo_item.Enable(undo.stack().canredo())

        event.Skip()
926520
protected function UpdateItemInfo()
    {
        $this->dPriceTotal = $this->dAmount * $this->dPrice;
        $this->dTotalWeight = $this->dAmount * $this->fieldSizeWeight;
        $this->dTotalVolume = $this->dAmount * $this->dVolume;
        $this->dPriceAfterDiscount = $this->dPrice;
        $this->dPriceTotalAfterDiscount = $this->dPriceTotal;
        $this->dPriceTotalAfterDiscountWithoutVouchers = $this->dPriceTotalAfterDiscount;
    }
361771
def update(cls, spec, updates, upsert=False):
        '''
        
        '''
        if 'key' in spec:
            previous = cls.get(spec['key'])
        else:
            previous = None
        if previous:
            # Update existing data.
            current = cls(**previous.__dict__)
        elif upsert:
            # Create new data.
            current = cls(**spec)
        else:
            current = None
        # XXX Should there be any error thrown if this is a noop?
        if current:
            current.__dict__.update(updates)
            current.save()
        return current
553852
protected function _update()
    {
        $this->oxnews__oxdate->setValue(\OxidEsales\Eshop\Core\Registry::getUtilsDate()->formatDBDate($this->oxnews__oxdate->value, true));

        parent::_update();
    }
903750
def update(self, *args, **kwargs):
        """"""
        self._call_helper("Updating", self.real.update, *args, **kwargs)
102394
private function update()
    {
        $Eresus = Eresus_CMS::getLegacyKernel();

        $item = $Eresus->db->selectItem($this->table['name'], "`id`='" . arg('update') . "'");
        $old_file = $item['image'];
        $item['caption'] = arg('caption', 'dbsafe');
        $item['active'] = arg('active', 'int');
        if (arg('section'))
        {
            $item['section'] = '|' . implode('|', arg('section')) . '|';
        }
        $item['block'] = arg('block', 'dbsafe');
        $item['priority'] = arg('priority', 'int');
        $item['showFrom'] = arg('showFrom', 'dbsafe');
        $item['showTill'] = arg('showTill', 'dbsafe');
        $item['showCount'] = arg('showCount', 'int');
        $item['html'] = arg('html', 'dbsafe');
        $item['image'] = arg('image');
        $item['width'] = arg('width', 'int');
        $item['height'] = arg('height', 'int');
        $item['url'] = arg('url', 'dbsafe');
        $item['target'] = arg('target', 'dbsafe');

        if ($item['showTill'] == '')
        {
            unset($item['showTill']);
        }
        if (arg('flushShowCount'))
        {
            $item['shows'] = 0;
        }
        if (is_uploaded_file($_FILES['image']['tmp_name']))
        {
            $path = $Eresus->fdata . $this->name . '/';
            if (is_file($path . $old_file))
            {
                unlink($path . $old_file);
            }
            $filename = 'banner' . $item['id'] .
                substr($_FILES['image']['name'], strrpos($_FILES['image']['name'], '.'));
            upload('image', $path . $filename);
            $item['image'] = $filename;
        }

        $Eresus->db->updateItem($this->table['name'], $item, "`id`='" . $item['id'] . "'");

        if ($item['showTill'] == '')
        {
            $Eresus->db->query(
                "UPDATE " . $Eresus->db->prefix . $this->table['name'] .
                " SET `showTill` = NULL WHERE `id`='" . $item['id'] . "'");
        }

        HTTP::redirect(arg('submitURL'));
    }
931228
def update(uid, post_data):
        '''
        
        '''
        raw_rec = TabTag.get(TabTag.uid == uid)
        entry = TabTag.update(
            name=post_data['name'] if 'name' in post_data else raw_rec.name,
            slug=post_data['slug'] if 'slug' in post_data else raw_rec.slug,
            order=post_data['order'] if 'order' in post_data else raw_rec.order,
            kind=post_data['kind'] if 'kind' in post_data else raw_rec.kind,
            pid=post_data['pid'],
        ).where(TabTag.uid == uid)
        entry.execute()
704434
def update(self, item, dry_run=None):
        """"""
        logger.debug('Updating item. Item: {item} Path: {data_file}'.format(
            item=item,
            data_file=self.data_file
        ))
        self.delete(item, dry_run=dry_run)
        return self.create(item, dry_run=dry_run)
894791
function update () {
      sourceOrOptions.bundle()
        .pipe(concat(function (data) {
          add(filepath, data.toString())
        }))
        .on('error', function (err) {
          console.error(err.stack)
          ASSET_PENDING--
        })
    }
1119304
function update() {
		var f = self.fm.getSelected(0);
		reset();

		self._hash = f.hash;
		self.title.text(f.name);
		self.win.addClass(self.fm.view.mime2class(f.mime));
		self.name.text(f.name);
		self.kind.text(self.fm.view.mime2kind(f.link ? 'symlink' : f.mime)); 
		self.size.text(self.fm.view.formatSize(f.size));
		self.date.text(self.fm.i18n('Modified')+': '+self.fm.view.formatDate(f.date));
		f.dim && self.add.append('<span>'+f.dim+' px</span>').show();
		f.tmb && self.ico.css('background', 'url("'+f.tmb+'") 0 0 no-repeat');
		if (f.url) {
			self.url.text(f.url).attr('href', f.url).show();
			for (var i in self.plugins) {
				if (self.plugins[i].test && self.plugins[i].test(f.mime, self.mimes, f.name)) {
					self.plugins[i].show(self, f);
					return;
				}
			}
		} else {
			self.url.hide();
		}
		
		self.win.css({
			width  : '420px',
			height : 'auto'
		});
	}
1326669
def update(args):
    
    # Check specifying some new values
    if ((not args.__dict__.get('new_type') and
         not args.__dict__.get('new_content') and
         not args.__dict__.get('new_ttl') and
         not args.__dict__.get('new_priority'))):
        utils.error("Not update any values.")

    args.__dict__['search'] = (args.__dict__.get('name') + ',' +
                               args.__dict__.get('rtype') + ',' +
                               args.__dict__.get('content'))

    args.__dict__['raw_flag'] = True
    data = get(args)
    if len(data.get('records')) == 1:
        cur_ttl = data.get('records')[0].get('ttl')
        cur_priority = data.get('records')[0].get('priority')
    elif len(data.get('records')) > 1:
        utils.error("Match multiple records")
    else:
        utils.error("No match records")

    new_args = copy.copy(args)

    if new_args.__dict__.get('new_type'):
        new_args.__dict__['rtype'] = new_args.__dict__.get('new_type')

    if new_args.__dict__.get('new_content'):
        new_args.__dict__['content'] = new_args.__dict__.get('new_content')

    if new_args.__dict__.get('new_ttl'):
        new_args.__dict__['ttl'] = new_args.__dict__.get('new_ttl')
    else:
        new_args.__dict__['ttl'] = cur_ttl

    if new_args.__dict__.get('new_priority'):
        new_args.__dict__['priority'] = new_args.__dict__.get('new_priority')
    else:
        if cur_priority:
            new_args.__dict__['priority'] = cur_priority

    delete(args)
    create(new_args)
488325
def update(self, instance, oldValue, newValue):
    """"""
    self.__set__(instance,
                 self.__get__(instance, None) + newValue - (oldValue or 0))
971469
public function update(Product $product, UpdateProductRequest $request)
    {
        $this->product->update($product, $request->all());

        return redirect()->route('admin.product.product.index')
            ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::products.title.products')]));
    }
132139
def update(self, **args):
        """"""
        data = {}
        for field in args:
            data[field] = args[field]

        super(Version, self).update(**data)
284044
def update(self, infos):
        """"""
        genes = [i for i in infos if isinstance(i, LearningGene)]
        for gene in genes:
            if (
                self.network.role == "experiment"
                and self.generation > 0
                and random.random() < 0.10
            ):
                self.mutate(gene)
            else:
                self.replicate(gene)
127496
def update_shipment(self, resource_id, data):
        """"""
        return Shipments(self.client).on(self).update(resource_id, data)