Skip to content

Commit

Permalink
Removed some cruft left over from fixing problems in the move to Deci…
Browse files Browse the repository at this point in the history
…malField

([5302]).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5311 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed May 21, 2007
1 parent 35cc9d9 commit d15809c
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions django/core/serializers/json.py
Expand Up @@ -35,7 +35,6 @@ def Deserializer(stream_or_string, **options):
stream = StringIO(stream_or_string) stream = StringIO(stream_or_string)
else: else:
stream = stream_or_string stream = stream_or_string
#for obj in PythonDeserializer(simplejson.load(stream, cls=DjangoJSONDecoder)):
for obj in PythonDeserializer(simplejson.load(stream)): for obj in PythonDeserializer(simplejson.load(stream)):
yield obj yield obj


Expand All @@ -62,25 +61,3 @@ def default(self, o):
# Older, deprecated class name (for backwards compatibility purposes). # Older, deprecated class name (for backwards compatibility purposes).
DateTimeAwareJSONEncoder = DjangoJSONEncoder DateTimeAwareJSONEncoder = DjangoJSONEncoder


## Our override for simplejson.JSONNumber, because we want to use decimals in
## preference to floats (we can convert decimal -> float when they stored, if
## needed, but cannot go the other way).
#def DjangoNumber(match, context):
# match = DjangoNumber.regex.match(match.string, *match.span())
# integer, frac, exp = match.groups()
# if exp:
# res = float(integer + (frac or '') + (exp or ''))
# elif frac:
# res = decimal.Decimal(integer + frac)
# else:
# res = int(integer)
# return res, None
#decoder.pattern(r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?')(DjangoNumber)
#
#converters = decoder.ANYTHING[:]
#converters[-1] = DjangoNumber
#decoder.JSONScanner = decoder.Scanner(converters)
#
#class DjangoJSONDecoder(simplejson.JSONDecoder):
# _scanner = decoder.Scanner(converters)
#

0 comments on commit d15809c

Please sign in to comment.