def validate_set(self): change = self._check_load() for fname in self.mgroup.mfields: field = self.mgroup.mfields[fname] change = change or not field.get_state_attrs(self).get('valid', True) field.get_state_attrs(self)['valid'] = True if change: self.signal('record-changed') self.reload() return change
def validate_set(self): change = self._check_load() for fname in self.mgroup.mfields: field = self.mgroup.mfields[fname] change = change or not field.get_state_attrs(self).get( 'valid', True) field.get_state_attrs(self)['valid'] = True if change: self.signal('record-changed') self.reload() return change
def get(self, get_readonly=True, includeid=False, check_load=True, get_modifiedonly=False): if check_load: self._check_load() value = [] for name, field in self.mgroup.mfields.items(): if (get_readonly or not field.get_state_attrs(self).get('readonly', False)) \ and (not get_modifiedonly or (field.name in self.modified_fields or isinstance(field, O2MField))): value.append((name, field.get(self, readonly=get_readonly, modified=get_modifiedonly))) value = dict(value) if includeid: value['id'] = self.id return value
def _get_invalid_fields(self): res = [] for fname, field in self.mgroup.mfields.items(): if not field.get_state_attrs(self).get('valid', True): res.append((fname, field.attrs['string'])) return dict(res)