mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
.validate() on serializer fields
This commit is contained in:
parent
9805a085fb
commit
d2d412993f
|
@ -254,6 +254,7 @@ class Field(object):
|
|||
|
||||
value = self.to_internal_value(data)
|
||||
self.run_validators(value)
|
||||
self.validate(value)
|
||||
return value
|
||||
|
||||
def run_validators(self, value):
|
||||
|
@ -270,6 +271,9 @@ class Field(object):
|
|||
if errors:
|
||||
raise ValidationError(errors)
|
||||
|
||||
def validate(self, value):
|
||||
pass
|
||||
|
||||
def to_internal_value(self, data):
|
||||
"""
|
||||
Transform the *incoming* primative data into a native value.
|
||||
|
|
Loading…
Reference in New Issue
Block a user