def fieldChanged(self, key, field): path = self._path + "." + unicode(key) path = path.replace('__root__.', '') if field == "*": self._throw(Editor.Out.FieldChanged, Editor.translatePath(self._document, path)) else: self._throw(Editor.Out.FieldChanged, Editor.translatePath(self._document, path + "." + field))
def dataChanged(self, sel): path = self._path + ".*" path = path.replace('__root__.', '') self._throw(Editor.Out.FieldChanged, Editor.translatePath(self._document, path)) self._document.select(self._path + '.*', sel) if self._delegate: self._delegate.selectRow(sel)
def _updateAll(self): if self._editDoc is None or self._doc is None: return if self._path is not None: self._editDoc.set(self._path, self._doc.get(self._path)) path = Editor.translatePath(self._editDoc, self._path) self._throw(Editor.Out.FieldChanged, path) else: id = self._editDoc.get('_id') rev = self._editDoc.get('_rev') self._editDoc._data = copy.deepcopy(self._doc._data) self._editDoc.set('_id', id) if rev is not None: self._editDoc.set('_rev', rev) self._throw(Editor.Out.FieldChanged, "")