create route by form
This commit is contained in:
SDE
2023-07-22 14:26:53 +03:00
parent c58c25b049
commit 4c569165f1
3 changed files with 13 additions and 3 deletions

View File

@@ -41,11 +41,18 @@ def create_route_ajax(request):
html = render_to_string('blocks/profile/b_new_route.html', Dict, request=request)
return JsonResponse({'html': html}, status=400)
obj = form.save(commit=False)
obj.owner = request.user
obj.save()
routes = Route.objects.filter(owner=request.user)
Dict = {
'routes': routes
}
html = render_to_string('blocks/profile/b_my_routes.html', Dict, request=request)
res_Dict = {
'html': '!!!'
'html': html
}
return JsonResponse(res_Dict)