diff options
| author | Tom Christie | 2012-09-03 14:28:40 +0100 |
|---|---|---|
| committer | Tom Christie | 2012-09-03 14:28:40 +0100 |
| commit | 7abef9ac3b3fb20a6cdef5d52c640e5725c93437 (patch) | |
| tree | 2cd3270b7079f8b20eb3e3e90d8181c37c4199cb /djangorestframework/utils | |
| parent | d180e984e9779673c2d8aab3c65b4763432ba6b5 (diff) | |
| download | django-rest-framework-7abef9ac3b3fb20a6cdef5d52c640e5725c93437.tar.bz2 | |
Parsers may return raw data, or a DataAndFiles object
Diffstat (limited to 'djangorestframework/utils')
| -rw-r--r-- | djangorestframework/utils/encoders.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/djangorestframework/utils/encoders.py b/djangorestframework/utils/encoders.py index 3cd2e8e1..ba7c8553 100644 --- a/djangorestframework/utils/encoders.py +++ b/djangorestframework/utils/encoders.py @@ -1,3 +1,6 @@ +""" +Helper classes for parsers. +""" import datetime import decimal from django.utils import timezone @@ -6,10 +9,12 @@ from django.utils import simplejson as json class JSONEncoder(json.JSONEncoder): """ - JSONEncoder subclass that knows how to encode date/time and decimal types. + JSONEncoder subclass that knows how to encode date/time, + decimal types, and generators. """ def default(self, o): - # See "Date Time String Format" in the ECMA-262 specification. + # For Date Time string spec, see ECMA 262 + # http://ecma-international.org/ecma-262/5.1/#sec-15.9.1.15 if isinstance(o, datetime.datetime): r = o.isoformat() if o.microsecond: |
