示例#1
0
 def check_row(self, field_name_to_value_map, location):
     row_key = tuple(field_name_to_value_map[field_name]
                     for field_name in self._field_names_to_check)
     see_also_location = self._row_key_to_location_map.get(row_key)
     if see_also_location is not None:
         raise errors.CheckError(
             _("values for %r must be unique: %s") %
             (self._field_names_to_check, row_key),
             location,
             see_also_message=_("location of first occurrence"),
             see_also_location=see_also_location)
     else:
         self._row_key_to_location_map[row_key] = copy.copy(location)
示例#2
0
 def check_at_end(self, location):
     if not self._eval():
         raise errors.CheckError(
             _("distinct count is %d but check requires: %r") %
             (self._distinct_count(), self._expression), location)