aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/fields.py
diff options
context:
space:
mode:
authorTom Christie2014-10-07 17:04:53 +0100
committerTom Christie2014-10-07 17:04:53 +0100
commit6bfed6f8525a49fc50df7143ac2d492528b8f2ac (patch)
treeb9d86e1e6cb9b8645565a7f322eedb44db88d43a /rest_framework/fields.py
parent3a3e2bf57d5443dc0b058d5beb3111f87c418947 (diff)
downloaddjango-rest-framework-6bfed6f8525a49fc50df7143ac2d492528b8f2ac.tar.bz2
Enforce uniqueness validation for relational fields
Diffstat (limited to 'rest_framework/fields.py')
-rw-r--r--rest_framework/fields.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py
index 0963d4bf..9d577c53 100644
--- a/rest_framework/fields.py
+++ b/rest_framework/fields.py
@@ -224,6 +224,8 @@ class Field(object):
"""
if self.default is empty:
raise SkipField()
+ if is_simple_callable(self.default):
+ return self.default()
return self.default
def run_validation(self, data=empty):