Add or update an existing object.
779935
def set_object(self, name: str, pobj: ParameterObject) -> None:
        """"""
        self.objects[zlib.crc32(name.encode())] = pobj
647748
def add_to(self, parent, additions):
        ""
        for x in additions:
            if x not in parent:
                parent.append(x)
                self.changed()
342716
def _add(self, obj, data, **kwargs):
        
        if isinstance(obj, sqlalchemy.orm.query.Query):
            obj = obj.one()
        obj = self.preprocessing(obj=obj or self.table)\
            .add(self.session, data, self.table)
        self.session.add(obj)
        if kwargs.get('commit', self.commit) is True:
            try:
                self.session.commit()
            except AssertionError:
                transaction.commit()
        return obj
562706
def add_or_update(self, section, key, value):
        
        updates = self.update(section, key, value)
        if updates == 0:
            self.add(section, key, value)
        return updates
183894
def add(self, resource, replace=False):
        """"""
        uri = resource.uri
        if (uri in self and not replace):
            raise ResourceSetDupeError(
                "Attempt to add resource already in this set")
        self[uri] = resource
903750
def update(self, *args, **kwargs):
        """"""
        self._call_helper("Updating", self.real.update, *args, **kwargs)
1349498
private ObjectResult addOrUpdateObject(DBObject                          dbObj,
                                           Map<String, String>               currScalarMap,
                                           Map<String, Map<String, Integer>> targObjShardNos)
            throws IOException {
        ObjectUpdater objUpdater = new ObjectUpdater(m_tableDef);
        if (targObjShardNos.size() > 0) {
            objUpdater.setTargetObjectShardNumbers(targObjShardNos);
        }
        if (currScalarMap == null || currScalarMap.size() == 0) {
            return objUpdater.addNewObject(m_parentTran, dbObj);
        } else {
            return objUpdater.updateObject(m_parentTran, dbObj, currScalarMap);
        }
    }
186053
def update(self, *args, **kwargs):
        """"""
        self._extend(args, kwargs, 'update', self._update_items)
257570
def _add(self, codeobj):
        """"""
        assert isinstance(codeobj, CodeExpression.TYPES)
        self.arguments = self.arguments + (codeobj,)
999933
def _add(self, codeobj):
        """"""
        assert isinstance(codeobj, CodeVariable)
        self.variables.append(codeobj)
1259070
protected void updateObject(final Object object) {
		if (logger.isDebugEnabled()) {
			logger.debug("merging " + object + "...");
		}
		getCurrentSession().beginTransaction();
		Object merged = getHibernateTemplate().merge(object);
		if (logger.isDebugEnabled()) {
			logger.debug("done, updating " + merged + "...");
		}
		getHibernateTemplate().update(merged);
		getCurrentSession().getTransaction().commit();
		if (logger.isDebugEnabled()) {
			logger.debug("done.");
		}
	}
1217860
def update(self, obj):
        
        if isinstance(obj, APPMessage):
            self._header = obj._header
            self._payload = obj._payload
75112
def alter_object(self, obj):
        
        for attname, field, replacer in self.replacers:
            currentval = getattr(obj, attname)
            replacement = replacer(self, obj, field, currentval)
            setattr(obj, attname, replacement)
1353318
def _update(self, data):
        """"""
        for k, v in six.iteritems(data):
            new_value = v
            if isinstance(v, dict):
                new_value = type(self)(v)
            elif isinstance(v, list):
                new_value = [(type(self)(e) if isinstance(e, dict) else e)
                             for e in v]
            setattr(self, k, new_value)
375873
def set_object(self, obj, properties):
        """"""
        self._objects.add(obj)
        properties = set(properties)
        self._properties |= properties
        pairs = self._pairs
        for p in self._properties:
            if p in properties:
                pairs.add((obj, p))
            else:
                pairs.discard((obj, p))
429136
def add_or_update(uid, post_data):
        '''
        
        '''
        cur_rec = MPost.get_by_uid(uid)
        if cur_rec:
            MPost.update(uid, post_data)
        else:
            MPost.create_post(uid, post_data)
549544
def create_or_update(cls, object_version, key, value):
        """"""
        assert len(key) < 256
        assert len(value) < 256
        obj = cls.get(object_version, key)
        if obj:
            obj.value = value
            db.session.merge(obj)
        else:
            obj = cls.create(object_version, key, value)
        return obj