(self, allow_unicode=False, **kwargs)
| 798 | } |
| 799 | |
| 800 | def __init__(self, allow_unicode=False, **kwargs): |
| 801 | super().__init__(**kwargs) |
| 802 | self.allow_unicode = allow_unicode |
| 803 | if self.allow_unicode: |
| 804 | validator = RegexValidator(re.compile(r'^[-\w]+\Z', re.UNICODE), message=self.error_messages['invalid_unicode']) |
| 805 | else: |
| 806 | validator = RegexValidator(re.compile(r'^[-a-zA-Z0-9_]+$'), message=self.error_messages['invalid']) |
| 807 | self.validators.append(validator) |
| 808 | |
| 809 | |
| 810 | class URLField(CharField): |