diff options
| author | Tom Christie | 2013-03-20 13:05:59 +0000 | 
|---|---|---|
| committer | Tom Christie | 2013-03-20 13:05:59 +0000 | 
| commit | 20fd738c856dfa21a0d2d251b92459d6641c782c (patch) | |
| tree | e201e6fd081d242c7ba4424af2a57f9b2791c1c8 /rest_framework/fields.py | |
| parent | 09e4ee7ae332326e77b23bac1539d31e582419e9 (diff) | |
| download | django-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.py | 5 | 
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) | 
