thirdparty/google_appengine/google/appengine/api/validation.py
changeset 2878 cf4b80992451
parent 2864 2e0b0af889be
equal deleted inserted replaced
2871:e440e94a874b 2878:cf4b80992451
   917     if not isinstance(value, list):
   917     if not isinstance(value, list):
   918       raise ValidationError('Repeated fields must be sequence, '
   918       raise ValidationError('Repeated fields must be sequence, '
   919                             'but found \'%s\'.' % value)
   919                             'but found \'%s\'.' % value)
   920 
   920 
   921     for item in value:
   921     for item in value:
   922       if not isinstance(item, self.constructor):
   922       if isinstance(self.constructor, Validator):
       
   923         item = self.constructor.Validate(item)
       
   924       elif not isinstance(item, self.constructor):
   923         raise ValidationError('Repeated items must be %s, but found \'%s\'.'
   925         raise ValidationError('Repeated items must be %s, but found \'%s\'.'
   924                               % (str(self.constructor), str(item)))
   926                               % (str(self.constructor), str(item)))
   925 
   927 
   926     return value
   928     return value