Validators¶
Adaptation of DRF uniqueness validators.
There are no constraints for unique-for-date in mongoengine.
-
class
rest_framework_mongoengine.validators.
UniqueTogetherValidator
(queryset, fields, message=None)¶ Bases:
rest_framework_mongoengine.validators.MongoValidatorMixin
,rest_framework.validators.UniqueTogetherValidator
Replacement of DRF UniqueTogetherValidator.
Used by
DocumentSerializer
for fields, present in unique indexes.
-
class
rest_framework_mongoengine.validators.
UniqueValidator
(queryset, message=None)¶ Bases:
rest_framework_mongoengine.validators.MongoValidatorMixin
,rest_framework.validators.UniqueValidator
Replacement of DRF UniqueValidator.
Used by
DocumentSerializer
for fields, present in unique indexes.