0
Return list from def2? Django
When I run this code an empty list is returned. Any idea why? Is it about async? Should I use async def view1(request): ? Code(short version): Html: button calls view1 Views.py: def view1(request): List = view2() return render(request, template, {'List': List}) def view2(): int = request.COOKIE['int'] List = postgresqlTable.objects.get(pk=int) return List When I put the code from view2 in view1 it works fine.
1 Réponse
0
can you share this code with code playground? The indentation has been destroyed, so I don’t know what’s going on.