.validate() on serializer fields

This commit is contained in:
Tom Christie 2014-09-29 11:24:21 +01:00
parent 9805a085fb
commit d2d412993f

View File

@ -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.