code: def set_errors(self, result):
          
  
          # todo: use wtf locale
          errors = result.get_messages()
  
          for property_name in errors:
              if not hasattr(self, property_name):
                  continue # ignore errors for missing fields
  
              prop_errors = errors[property_name]
              if type(prop_errors) is not list:
                  prop_errors = ['<Nested schema result following...>']
              if property_name in self.errors:
                  self.errors[property_name].extend(prop_errors)
              else:
                  self.errors[property_name] = prop_errors
docs: Populate field errors with errors from schema validation