Only allow ASCII and None values. Check against US-ASCII, a.k.a. 7-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the Unicode character set. Source: https://github.com/apache/cassandra/blob /3dcbe90e02440e6ee534f643c7603d50ca08482b/src/java/org/apache
(self, value)
| 400 | db_type = 'ascii' |
| 401 | |
| 402 | def validate(self, value): |
| 403 | """ Only allow ASCII and None values. |
| 404 | |
| 405 | Check against US-ASCII, a.k.a. 7-bit ASCII, a.k.a. ISO646-US, a.k.a. |
| 406 | the Basic Latin block of the Unicode character set. |
| 407 | |
| 408 | Source: https://github.com/apache/cassandra/blob |
| 409 | /3dcbe90e02440e6ee534f643c7603d50ca08482b/src/java/org/apache/cassandra |
| 410 | /serializers/AsciiSerializer.java#L29 |
| 411 | """ |
| 412 | value = super(Ascii, self).validate(value) |
| 413 | if value: |
| 414 | charset = value if isinstance( |
| 415 | value, (bytearray, )) else map(ord, value) |
| 416 | if not set(range(128)).issuperset(charset): |
| 417 | raise ValidationError( |
| 418 | '{!r} is not an ASCII string.'.format(value)) |
| 419 | return value |
| 420 | |
| 421 | |
| 422 | class Integer(Column): |
nothing calls this directly
no test coverage detected