We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7fbf2e8 commit 217b31fCopy full SHA for 217b31f
1 file changed
ietf/utils/validators.py
@@ -5,11 +5,12 @@
5
import re
6
7
from django.core.exceptions import ValidationError
8
+from django.utils.deconstruct import deconstructible
9
-
10
+@deconstructible
11
class RegexStringValidator(object):
12
- def __init__(self,):
13
+ def __init__(self):
14
pass
15
16
def __call__(self, value):
@@ -28,5 +29,10 @@ def __call__(self, value):
28
29
'Maybe you meant to write "-.*"? If you actually meant "-*", '
30
'you can use "[-]*" instead to get past this error.')
31
32
+ def __eq__(self, other):
33
+ return isinstance(other, RegexStringValidator)
34
+
35
+ def __ne__(self, other):
36
+ return not (self == other)
37
38
validate_regular_expression_string = RegexStringValidator()
0 commit comments