how do i serialize output of a query with select related into a json ? When i serialize data from query with select_related, the resultant json doesn\'t contain related field d
views.py
from django.utils import simplejson
def convert_to_json():
uinfo = Userinfo.objects.filter(userId_id__in=inner_qs).values('userId__username', 'userImg', 'says', 'userId__first_name', 'city')
lusers = ValuesQuerySetToDict(users)
response = simplejson.dumps(lusers)
return response
def ValuesQuerySetToDict(vqs):
return [item for item in vqs]