Commit d2d41299 by Tom Christie

.validate() on serializer fields

parent 9805a085
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment