def _check_data(self): vlog = AttrVerifyLogger(u'', self.uuid) self.clazz.atstruct.verify(self.__data, self.project, vlog=vlog) vlog.log_all(self.project) self.__error_count = len(vlog.errors) return vlog
def verify(self, project, vlog=None): if vlog is None: vlog = AttrVerifyLogger('/Clazz/%s' % self.name) objects = project.object_manager.get_objects(self) # number limit if len(objects) > self.max_number: vlog.error("%s number exceeds limit: %s/%s", self.name, len(objects), self.max_number) if len(objects) < self.min_number: vlog.error("insufficient number of %s: %s/%s", self.name, len(objects), self.min_number) # unique attrs val = [obj.raw_data for obj in objects] verify_list_unique_attrs(self.atstruct, self.unique_attrs, val, project, vlog) return vlog