aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/fields.py
diff options
context:
space:
mode:
authorTom Christie2013-06-02 20:05:37 +0100
committerTom Christie2013-06-02 20:05:37 +0100
commit01e80ff9f77c075a01fc84c93f511a8b16ab3045 (patch)
tree1256ceaa20e267aaf49de474832ed3af78b01869 /rest_framework/fields.py
parent372ad01b74abb3e7872a128719bde4386c98cda4 (diff)
parentde1cc5f8c1393149781a8f9365449693af18af4e (diff)
downloaddjango-rest-framework-01e80ff9f77c075a01fc84c93f511a8b16ab3045.tar.bz2
Merge branch 'master' of https://github.com/woakas/django-rest-framework
Diffstat (limited to 'rest_framework/fields.py')
-rw-r--r--rest_framework/fields.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py
index 1534eeca..30bbafc4 100644
--- a/rest_framework/fields.py
+++ b/rest_framework/fields.py
@@ -250,6 +250,9 @@ class WritableField(Field):
self.validators = self.default_validators + validators
self.default = default if default is not None else self.default
+ if is_simple_callable(self.default):
+ self.default = self.default()
+
# Widgets are ony used for HTML forms.
widget = widget or self.widget
if isinstance(widget, type):