1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #3466 -- Fixed problem with specifyin a 'fields' argument to a JSON serializer. Also added documenation for the 'fields' argument.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5409 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2007-06-01 13:39:08 +00:00
parent 8728e0f353
commit ea07351799
6 changed files with 73 additions and 0 deletions

View File

@@ -21,6 +21,8 @@ class Serializer(PythonSerializer):
Convert a queryset to JSON.
"""
def end_serialization(self):
self.options.pop('stream', None)
self.options.pop('fields', None)
simplejson.dump(self.objects, self.stream, cls=DjangoJSONEncoder, **self.options)
def getvalue(self):

View File

@@ -18,6 +18,8 @@ class Serializer(PythonSerializer):
Convert a queryset to YAML.
"""
def end_serialization(self):
self.options.pop('stream', None)
self.options.pop('fields', None)
yaml.dump(self.objects, self.stream, **self.options)
def getvalue(self):