Guest User

Untitled

a guest
Aug 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. profile = Profile.objects.filter(user=request.user)
  2. serializer = ProfileSerializer(profile, many=True)
  3. myteam = JsonResponse(serializer.data, safe=False)
  4. print(myteam.content) ## to see what's being passed
  5.  
  6. console.log({{myteam}});
  7.  
  8. b'[{"user": "DAVE", "GK1": {"id": 1001, "ShortName": "J. Strummer", "Club": "CLUB", "Shirt": "SHIRT.png", "ShortClub": "ETC", "ShortPos": "FW", "CurrentVal": "10", "TotalPoints": 1}, "GK2": {"id": 320, "ShortName": "D. Jones", "Club": "CLUB2", "Shirt": "ETABE.png", "ShortClub": "ETABE", "ShortPos": "GK", "CurrentVal": "4.5",
  9.  
  10. Uncaught SyntaxError: Invalid or unexpected token
  11.  
  12. console.log(b'[{"user": "mikey", "GK1": {"id": 1001, "ShortName": "J. Strummer", "Club": "ETC", "Shirt": "SHIRT.png", "ShortClub": "ETC", "ShortPos": "FW", "CurrentVal": "10.0", "TotalPoints": 1}, // lot's more of this
  13.  
  14. player = Player.objects.all()
  15. serializer = PlayerSerializer(player, many=True)
  16. return JsonResponse(serializer.data, safe=False)
  17.  
  18. myteam = JsonResponse(serializer.data, safe=False)
  19.  
  20. return JsonResponse(serializer.data, safe=False)
Add Comment
Please, Sign In to add comment