(self, value)
| 381 | super(Text, self).__init__(**kwargs) |
| 382 | |
| 383 | def validate(self, value): |
| 384 | value = super(Text, self).validate(value) |
| 385 | if not isinstance(value, (str, bytearray)) and value is not None: |
| 386 | raise ValidationError('{0} {1} is not a string'.format(self.column_name, type(value))) |
| 387 | if self.max_length is not None: |
| 388 | if value and len(value) > self.max_length: |
| 389 | raise ValidationError('{0} is longer than {1} characters'.format(self.column_name, self.max_length)) |
| 390 | if self.min_length: |
| 391 | if (self.min_length and not value) or len(value) < self.min_length: |
| 392 | raise ValidationError('{0} is shorter than {1} characters'.format(self.column_name, self.min_length)) |
| 393 | return value |
| 394 | |
| 395 | |
| 396 | class Ascii(Text): |
nothing calls this directly
no test coverage detected