Set the value of the field
432360
def _set(self, instance, value, **kw):
        
        logger.debug("DexterityFieldManager::set: value=%r" % value)

        # Check if the field is read only
        if self.field.readonly:
            raise Unauthorized("Field is read only")

        fieldname = self.get_field_name()
        # id fields take only strings
        if fieldname == "id":
            value = str(value)

        try:
            # Validate
            self.field.validate(value)

            # TODO: Check security on the field level
            return self.field.set(instance, value)
        except WrongType:
            logger.warn("WrongType: Field={} Value={}".format(self.field, value))
        except:  # noqa
            logger.warn("Unknown Exception: Field={} Value={}".format(self.field, value))
638743
function setNestedValue(data, field, value) {
        var fieldParts = _.isArray(field) ? field : field.split('.');

        // if no nesting, just set the value
        if (fieldParts.length === 1) {
            data[field] = _.isString(value) ? value.trim() : value;
            return;
        }

        // make sure the parent value exists
        data[fieldParts[0]] = data[fieldParts[0]] || {};

        // recursively call to go down a level
        setNestedValue(data[fieldParts[0]], fieldParts.slice(1, fieldParts.length), value);
    }
128095
private void set(String fieldName, Object value) {
    try {
      String subField;
      Iterator<String> levels = Splitter.on(".").split(fieldName).iterator();
      GenericRecord toInsert = record;
      subField = levels.next();
      Object subRecord = toInsert;

      while (levels.hasNext()) {
        if (subRecord instanceof GenericRecord) {
          subRecord = ((GenericRecord)subRecord).get(subField);
        } else if (subRecord instanceof List) {
          subRecord = ((List)subRecord).get(Integer.parseInt(subField));
        } else if (subRecord instanceof Map) {
          subRecord = ((Map)subRecord).get(subField);
        }

        if (subRecord == null) {
          throw new FieldDoesNotExistException("Field " + subField + " not found when trying to set " + fieldName);
        }
        subField = levels.next();
      }

      if (!(subRecord instanceof GenericRecord)) {
        throw new IllegalArgumentException("Field " + fieldName + " does not refer to a record type.");
      }

      toInsert = (GenericRecord)subRecord;
      Object oldValue = toInsert.get(subField);

      toInsert.put(subField, value);

      Schema.Field changedField = toInsert.getSchema().getField(subField);
      GenericData genericData = GenericData.get();

      boolean valid = genericData
          .validate(changedField.schema(), genericData.getField(toInsert, changedField.name(), changedField.pos()));
      if (!valid) {
        toInsert.put(subField, oldValue);
        throw new IncorrectTypeException(
            "Incorrect type - can't insert a " + value.getClass().getCanonicalName() + " into an Avro record of type "
                + changedField.schema().getType().toString());
      }
    } catch (AvroRuntimeException e) {
      throw new FieldDoesNotExistException("Field not found setting name " + fieldName, e);
    }
  }
728542
def update_field(self, name, value):
        
        kwargs = {}
        kwargs['field.' + name] = value
        return self.post(**kwargs)
1160897
def set_input(self):
		
		name = self.attrs.get("_override", self.widget.__class__.__name__)
		self.values["field"] = str(FIELDS.get(name, FIELDS.get(None))(self.field, self.attrs))
505746
def set_custom_value(self, field_name, value):
        
        custom_field = self.get_custom_field(field_name)
        custom_value = CustomFieldValue.objects.get_or_create(
            field=custom_field, object_id=self.id)[0]
        custom_value.value = value
        custom_value.save()
509796
def set_value(self, field_name, value):
        
        if field_name in self.fields:
            if not value is None:
                self._dict['attributes'][field_name] = _unicode_convert(value)
            else:
                pass
        elif field_name.upper() in ['SHAPE', 'SHAPE@', "GEOMETRY"]:
            if isinstance(value, dict):
                if 'geometry' in value:
                    self._dict['geometry'] = value['geometry']
                elif any(k in value.keys() for k in ['x','y','points','paths','rings', 'spatialReference']):
                    self._dict['geometry'] = value
            elif isinstance(value, AbstractGeometry):
                self._dict['geometry'] = value.asDictionary
            elif arcpyFound:
                if isinstance(value, arcpy.Geometry) and \
                   value.type == self.geometryType:
                    self._dict['geometry']=json.loads(value.JSON)
            self._geom = None
            self._geom = self.geometry
        else:
            return False
        self._json = json.dumps(self._dict, default=_date_handler)
        return True
1181100
def _pfp__set_value(self, new_val):
        
        if not isinstance(new_val, Field):
            new_val = utils.binary(utils.string_escape(new_val))
        super(String, self)._pfp__set_value(new_val)
663173
public static final void setValue(Object obj, String fieldName, 
            Object value) {
        try {
            getField(obj.getClass(), fieldName).set(obj, value);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
209744
public function setNewValue(string $field, $value) : void
    {
        $change = $this->objectChangeSet->getFieldChange($field);

        if ($change !== null) {
            $change->setNewValue($value);
        } else {
            $this->objectChangeSet->addChange(new Change($field, null, $value));
        }
    }
389352
def set_value_field(self, model, field_name):
        
        fields = fields_for_model(model, fields=[field_name])
        self.fields['value'] = fields[field_name]
413703
def set_value(self, key, field, value):
        """"""
        self._db.hset(key, field, value)
1209084
public function setFieldValue($object, $field, $value)
    {
        $this->assertObjectInstance($object);

        return $this->getField($field)->set($object, $value);
    }
456249
public void set(String fieldName, Object value) throws IOException {
    getValueMarshaller(fieldName).setWritableObject(struct, value);
    LOG.debug("Set {}={}", fieldName, value);
  }
631030
def setField(self, new_value):
        
        self.field_strength = self.field_strength._replace(
            val=new_value
        )
356462
public static void setFieldValue(Object obj, String fieldName, Object value) throws UtilException {
		Assert.notNull(obj);
		Assert.notBlank(fieldName);
		setFieldValue(obj, getField(obj.getClass(), fieldName), value);
	}
937632
private void setField(Field field, Object instance, Object value) throws SlickXMLException {
		try {
			field.setAccessible(true);
			field.set(instance, value);
		} catch (IllegalArgumentException e) {
			throw new SlickXMLException("Failed to set: "+field+" for an XML attribute, is it valid?", e);
		} catch (IllegalAccessException e) {
			throw new SlickXMLException("Failed to set: "+field+" for an XML attribute, is it valid?", e);
		} finally {
			field.setAccessible(false);
		}
	}