| 656 | |
| 657 | |
| 658 | class Validator: |
| 659 | def __deepcopy__(self, memo): |
| 660 | return copy.copy(self) |
| 661 | |
| 662 | def __init__(self, msg, test, jstest=None): |
| 663 | utils.autoassign(self, locals()) |
| 664 | |
| 665 | def valid(self, value): |
| 666 | try: |
| 667 | return self.test(value) |
| 668 | except: |
| 669 | return False |
| 670 | |
| 671 | |
| 672 | notnull = Validator("Required", bool) |
no outgoing calls