aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/fields.py
diff options
context:
space:
mode:
authorTom Christie2013-08-29 20:52:46 +0100
committerTom Christie2013-08-29 20:52:46 +0100
commit19f9adacb254841d02f43295baf81406ce3c60eb (patch)
treef77644b5515c15e09d49d12aef0855c67262f9ba /rest_framework/fields.py
parente4d2f54529bcf538be93da5770e05b88a32da1c7 (diff)
parent02b6836ee88498861521dfff743467b0456ad109 (diff)
downloaddjango-rest-framework-19f9adacb254841d02f43295baf81406ce3c60eb.tar.bz2
Merge branch 'master' into display-raw-data
Diffstat (limited to 'rest_framework/fields.py')
-rw-r--r--rest_framework/fields.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py
index 3e0ca1a1..210c2537 100644
--- a/rest_framework/fields.py
+++ b/rest_framework/fields.py
@@ -514,6 +514,11 @@ class ChoiceField(WritableField):
return True
return False
+ def from_native(self, value):
+ if value in validators.EMPTY_VALUES:
+ return None
+ return super(ChoiceField, self).from_native(value)
+
class EmailField(CharField):
type_name = 'EmailField'