mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-02 20:54:42 +03:00
Ensure validators are new-style classes on python2
This commit is contained in:
parent
cda74b5997
commit
32c885c2a0
|
@ -13,7 +13,7 @@ from rest_framework.exceptions import ValidationError
|
||||||
from rest_framework.utils.representation import smart_repr
|
from rest_framework.utils.representation import smart_repr
|
||||||
|
|
||||||
|
|
||||||
class UniqueValidator:
|
class UniqueValidator(object):
|
||||||
"""
|
"""
|
||||||
Validator that corresponds to `unique=True` on a model field.
|
Validator that corresponds to `unique=True` on a model field.
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ class UniqueValidator:
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
class UniqueTogetherValidator:
|
class UniqueTogetherValidator(object):
|
||||||
"""
|
"""
|
||||||
Validator that corresponds to `unique_together = (...)` on a model class.
|
Validator that corresponds to `unique_together = (...)` on a model class.
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ class UniqueTogetherValidator:
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
class BaseUniqueForValidator:
|
class BaseUniqueForValidator(object):
|
||||||
message = None
|
message = None
|
||||||
missing_message = _('This field is required.')
|
missing_message = _('This field is required.')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user