aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/fields.py
diff options
context:
space:
mode:
authorTom Christie2014-09-29 11:24:21 +0100
committerTom Christie2014-09-29 11:24:21 +0100
commitd2d412993f537952fd7809ded3e981f85ec318e9 (patch)
treebda05666e928bb06caabfd07da76b697a4f8e289 /rest_framework/fields.py
parent9805a085fb115785f272489dc24b51ba6f8e6329 (diff)
downloaddjango-rest-framework-d2d412993f537952fd7809ded3e981f85ec318e9.tar.bz2
.validate() on serializer fields
Diffstat (limited to 'rest_framework/fields.py')
-rw-r--r--rest_framework/fields.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py
index 231f693c..fee6080a 100644
--- a/rest_framework/fields.py
+++ b/rest_framework/fields.py
@@ -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.