﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26256	JSON serializer for subset of fields.	Sonu kumar	nobody	"{{{
class Country(models.Model):
    country = CountryField()

class City(models.Model):
    name = models.CharField(max_length=1000)
    country = models.ForeignKey(Country)

country = request.POST['country']
country = get_object_or_404(Country, country=country)
cities = serializers.serialize(""json"", country.city_set.all(), fields=('name', 'id'))
}}}

[https://docs.djangoproject.com/en/1.8/topics/serialization/#s-subset-of-fields]

According to above code snippet and document it should return JSON object with only name and id field but it returns 
{{{
[{""fields"": {""name"": ""Chennai""}, ""model"": ""job.city"", ""pk"": 1}]
}}}
instead of
{{{
[{""name"": ""Chennai"", ""id"": 1}]
}}}
which includes all fields of a model City."	Cleanup/optimization	closed	Documentation	1.8	Normal	fixed			Ready for checkin	1	0	0	0	0	0
