Click here to Skip to main content
15,562,144 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello My Brothers & Sisters Thank YOU, I managed to sort out the error by adding an index to int, but i am faced with a new error: invalid literal for int() with base 10: 'sessions'
def subs(request, pk):
sw = Swimmers.objects.filter(id=pk).values('sessions')
sw_list = map(int, sw [0])
sw_list = map(lambda x: x + 1, sw_list )
return JsonResponse(list(sw_list), safe=False)

What I have tried:

I have tried to remove .values('sessions') but nothing worked, Thanks For The Help, Much Appreciate.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900