diff options
| author | Tom Christie | 2013-06-02 20:05:37 +0100 |
|---|---|---|
| committer | Tom Christie | 2013-06-02 20:05:37 +0100 |
| commit | 01e80ff9f77c075a01fc84c93f511a8b16ab3045 (patch) | |
| tree | 1256ceaa20e267aaf49de474832ed3af78b01869 | |
| parent | 372ad01b74abb3e7872a128719bde4386c98cda4 (diff) | |
| parent | de1cc5f8c1393149781a8f9365449693af18af4e (diff) | |
| download | django-rest-framework-01e80ff9f77c075a01fc84c93f511a8b16ab3045.tar.bz2 | |
Merge branch 'master' of https://github.com/woakas/django-rest-framework
| -rw-r--r-- | rest_framework/fields.py | 3 |
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): |
