[ERROR]django serialize 'dict' object has no attribute '_meta'

r = yellowpage.objects.values("name","tel")
srvs_json = serializers.serialize("json", r)
HttpResponse(srvs_json)

报错:
serialize 'dict' object has no attribute '_meta'

解决:
values改为only

你可能感兴趣的:([ERROR]django serialize 'dict' object has no attribute '_meta')