Check if this name exists and if it does, find the value field
            note that update command needs an arg of <new value>.
            in case we're simply transferring, need to obtain old value first
166145
def name_transfer(self, key, new_address, value=None):
        

        key_details = self.name_show(key)

        if 'code' in key_details and key_details.get('code') == -4:
            return error_reply("Key does not exist")

        # get new 'value' if given, otherwise use the old 'value'
        if value is None:
            value = json.dumps(key_details['value'])

        if not self.unlock_wallet(self.passphrase):
            error_reply("Error unlocking wallet", 403)

        # transfer the name (underlying call is still name_update)
        try:
            # update the 'value'
            reply = self.obj.name_update(key, value, new_address)
        except JSONRPCException as e:
            return e.error

        return reply
539549
def update_name(options)
      if options.key?(:name) && options[:name].is_a?(String) && options[:name].length > 0
        return
      end
      hostname = if options.key?(:hostname) then
                   options[:hostname]
                 else
                   @args.default_values[:hostname]
                 end
      hostname = hostname[0] if hostname.is_a?(Array)
      options[:name] = hostname.gsub(/[^A-Za-z0-9_-]/, '-')
    end
514878
@Override
    public boolean updateValuesForField(String currentValue) {
        boolean bUpdated = false;
        FieldDefinition fieldDef = m_tableDef.getFieldDef(m_fieldName);
        if (fieldDef == null || !fieldDef.isCollection()) {
            bUpdated = updateSVScalar(currentValue);
        } else {
            bUpdated = updateMVScalar(currentValue);
        }
        return bUpdated;
    }
308312
def update(side, flds=nil)
      raise ArgumentError, 'The side to update must be :l or :r' unless [:l, :r].include?(side)
      target, source = (side==:l) ? [:l, :r] : [:r, :l]
      # use set field/s or update all
      flds ||= fields
      target_obj = self.send("#{target}_obj")
      source_obj = self.send("#{source}_obj")
      flds.each do |fld|
        target_name = fld.send("#{target}_name")
        source_name = fld.send("#{source}_name")
        # remember for log
        old_val = target_obj.send(target_name) rescue 'empty'
        # get new value through transfer method or direct
        new_val = if fld.transition?
                    cur_trans = fld.send("#{target}_trans")
                    eval "#{cur_trans} source_obj.send( source_name )"
                  else
                    source_obj.send( source_name )
                  end
        target_obj.send( "#{target_name}=" , new_val )

        log << "#{target_name} was: #{old_val} updated from: #{source_name} with value: #{new_val}"
      end
    end
1314734
def method_missing(name, *args, &block)
      super && return if new_record?
      name = name.to_s
      name[-1] == '=' ? set_field_value(name[0..-2], args[0]) : get_field_value(name) || find_pages_in_branch(name)
    end
615174
function ruleExistsFieldValueNotEqual($tablename, $field, $value, $error_message = null) {
        return $this->ruleExists($tablename, $field, '!' . $value, $error_message);
    }
456425
def _update_field(self, natvalue):
        
        updated = False
        if natvalue.element and natvalue.element != self.element:
            self.update(element=natvalue.element)
            self.pop('ip_descriptor', None)
            updated = True
        elif natvalue.ip_descriptor and self.ip_descriptor and \
            natvalue.ip_descriptor != self.ip_descriptor:
            self.update(ip_descriptor=natvalue.ip_descriptor)
            self.pop('element', None)
            updated = True

        for port in ('min_port', 'max_port'):
            _port = getattr(natvalue, port, None)
            if _port is not None and getattr(self, port, None) != _port:
                self[port] = _port
                updated = True
    
        return updated
886611
def cli(ctx, id_number, new_value, metadata=""):
    
    return ctx.gi.cannedvalues.update_value(id_number, new_value, metadata=metadata)
1008667
public function update( string $name, $value ) {
		if ( get_field( $name, 'option') ) {
			return update_field( $name, $value, 'option');
		} elseif ( get_option( $name ) ) {
			return update_option( $name, $value );
		}
		
		return FALSE;
	}
1029764
def update(self, **kwargs):
        '''  '''
        redis = type(self).get_redis()
        errors = ValidationErrors()

        for fieldname, field in self.proxy:
            if not field.fillable:
                continue

            given = kwargs.get(fieldname)

            if given is None:
                continue

            try:
                value = field.validate(kwargs.get(fieldname), redis)
            except BadField as e:
                errors.append(e)
                continue

            setattr(
                self,
                fieldname,
                value
            )

        if errors.has_errors():
            raise errors

        return self.save()
1357345
def clean_existing(self, value):
        
        existing_pk = value[self.pk_field]
        try:
            obj = self.fetch_existing(existing_pk)
        except ReferenceNotFoundError:
            raise ValidationError('Object does not exist.')
        orig_data = self.get_orig_data_from_existing(obj)

        # Clean the data (passing the new data dict and the original data to
        # the schema).
        value = self.schema_class(value, orig_data).full_clean()

        # Set cleaned data on the object (except for the pk_field).
        for field_name, field_value in value.items():
            if field_name != self.pk_field:
                setattr(obj, field_name, field_value)

        return obj
622637
def set_field_value(self, name, value):
        
        name = self.get_real_name(name)

        if not name or not self._can_write_field(name):
            return

        if name in self.__deleted_fields__:
            self.__deleted_fields__.remove(name)
        if self.__original_data__.get(name) == value:
            try:
                self.__modified_data__.pop(name)
            except KeyError:
                pass
        else:
            self.__modified_data__[name] = value
            self._prepare_child(value)
            if name not in self.__structure__ or not self.__structure__[name].read_only:
                return

            try:
                value.set_read_only(True)
            except AttributeError:
                pass
350380
public String put(String name,String value)
    {
        if (value==null)
            return remove(name);
        
        FieldInfo info=getFieldInfo(name);
        Field field=getField(info,false);
        // Look for value to replace.
        if (field!=null)
        {
            String old=(field._version==_version)?field._value:null;
            field.reset(value,_version);

            field=field._next;
            while(field!=null)
            {
                field.clear();
                field=field._next;
            }
            return old;    
        }
        else
        {
            // new value;
            field=new Field(info,value,_version);
            int hi=info.hashCode();
            if (hi<_index.length)
                _index[hi]=_fields.size();
            _fields.add(field);
            return null;
        }
    }
384220
def update(self, value=None):
        ''

        if value is not None and value is not UnknownLength:
            if (self.maxval is not UnknownLength
                and not 0 <= value <= self.maxval):

                raise ValueError('Value out of range')

            self.currval = value


        if not self._need_update(): return
        if self.start_time is None:
            raise RuntimeError('You must call "start" before calling "update"')

        now = time.time()
        self.seconds_elapsed = now - self.start_time
        self.next_update = self.currval + self.update_interval
        self.fd.write(self._format_line() + '\r')
        self.last_update_time = now
676548
def create_new(cls, oldvalue, *args):
    ""
    if oldvalue is not None:
        raise AlreadyExistsException('%r already exists' % (oldvalue,))
    return cls.create_instance(*args)
1326171
private static DBObject addFieldExistsCriterion(DBObject query, String field) {
        return new BasicDBObject(query.toMap()).append(field, new BasicDBObject("$exists", true));
    }
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)