I'm attempting to use the 'fields' option with the json serializer without any luck. The same call with the xml serializer works fine:
serializers.serialize("json", (Something.objects.get(pk=1), ), fields='myfield' )
breaks with:
Traceback (most recent call last):
File "<console>", line 1, in ?
File "C:\Python24\lib\site-packages\django\core\serializers\init.py", line 55, in serialize s.serialize(queryset, **options)
File "C:\Python24\lib\site-packages\django\core\serializers\base.py", line 49, in serialize self.end_serialization()
File "C:\Python24\lib\site-packages\django\core\serializers\json.py", line 19, in end_serialization
simplejson.dump(self.objects, self.stream, cls=DateTimeAwareJSONEncoder, **self.options)
File "C:\Python24\lib\site-packages\django\utils\simplejson\init.py", line 134, in dump check_circular=check_circular, allow_nan=allow_nan, indent=indent,
TypeError?: init() got an unexpected keyword argument 'fields'
Trying:
serializers.serialize("xml", (Something.objects.get(pk=1), ), fields='myfield' )
works fine however.