Ticket #3435: serialize_file_stream.patch
File serialize_file_stream.patch, 1.3 KB (added by , 18 years ago) |
---|
-
django/core/serializers/base.py
107 107 """ 108 108 Return the fully serialized queryset. 109 109 """ 110 return self.stream.getvalue() 110 # The file type doesn't have a getvalue method, so we'll do this 111 # carefully. 112 getvalue = getattr(self.stream, 'getvalue', None) 113 if getvalue and callable(getvalue): 114 return getvalue() 111 115 112 116 class Deserializer(object): 113 117 """ -
django/core/serializers/json.py
19 19 simplejson.dump(self.objects, self.stream, cls=DateTimeAwareJSONEncoder, **self.options) 20 20 21 21 def getvalue(self): 22 return self.stream.getvalue() 22 # The file type doesn't have a getvalue method, so we'll do this 23 # carefully. 24 getvalue = getattr(self.stream, 'getvalue', None) 25 if getvalue and callable(getvalue): 26 return getvalue() 23 27 24 28 def Deserializer(stream_or_string, **options): 25 29 """