aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/fields.py
diff options
context:
space:
mode:
authorTom Christie2013-03-20 13:05:59 +0000
committerTom Christie2013-03-20 13:05:59 +0000
commit20fd738c856dfa21a0d2d251b92459d6641c782c (patch)
treee201e6fd081d242c7ba4424af2a57f9b2791c1c8 /rest_framework/fields.py
parent09e4ee7ae332326e77b23bac1539d31e582419e9 (diff)
downloaddjango-rest-framework-20fd738c856dfa21a0d2d251b92459d6641c782c.tar.bz2
iso formated datetime aware fields with +0000 offset should use 'Z' suffix instead
Diffstat (limited to 'rest_framework/fields.py')
-rw-r--r--rest_framework/fields.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py
index 4b6931ad..a0f52f50 100644
--- a/rest_framework/fields.py
+++ b/rest_framework/fields.py
@@ -609,7 +609,10 @@ class DateTimeField(WritableField):
return None
if self.format.lower() == ISO_8601:
- return value.isoformat()
+ ret = value.isoformat()
+ if ret.endswith('+00:00'):
+ ret = ret[:-6] + 'Z'
+ return ret
return value.strftime(self.format)