SHARE
TWEET

response_json

h3dx0 Sep 20th, 2019 (edited) 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. >>> from app_apis.models import Serie
  2. >>> Serie.objects.all()
  3. <QuerySet [<Serie: Serie object (1)>, <Serie: Serie object (2)>]>
  4. >>> from rest_framework.response import Response
  5. >>> from app_apis.serializers import SerieSerializer
  6. >>> series = Serie.objects.all()
  7. >>> serializer = SerieSerializer(series, many=True)
  8. >>>
  9. import json
  10. json_data = {'msg': 'Carga lista', 'rc': 0, 'data': serializer.data}
  11.     return HttpResponse(json.dumps(json_data), content_type='application/json')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top