Skip to content
Snippets Groups Projects
Commit e189bbde authored by coin's avatar coin
Browse files

tentative de remake de PostNewBox (Django c'est pas si bien)

parent d69c7a39
Branches
No related tags found
No related merge requests found
No preview for this file type
...@@ -36,17 +36,16 @@ def deleteBox(request, boxId): ...@@ -36,17 +36,16 @@ def deleteBox(request, boxId):
# Create a new box from a Json request # Create a new box from a Json request
@csrf_exempt @csrf_exempt
def createBox(request): def createBox(request):
Own1 = User(Name="Coin", Email="Coin@Coin.com") #Own1 = User(Name=request.POST.get('UserName'), Email=request.POST.get('UserEmail'))
box = Box(Name=request.POST.get('Name'), Tag="Box", Owner=Own1, Home=None, StorageBox=None, StoredBox=None) #Own1.save()
#box.Name = request.POST.get('Name') #box.Name = request.POST.get('BoxName')
#box.Tag = request.POST.get('Tag') #box.Tag = request.POST.get('Tag')
#box.Owner = request.POST.get('Owner') #box.Owner = request.POST.get('Owner')
#box.Home = request.POST.get('Home') #box.Home = request.POST.get('Home')
#box.StorageBox = request.POST.get('StorageBox') #box.StorageBox = request.POST.get('StorageBox')
#box.StoredBox = request.POST.get('StoredBox') #box.StoredBox = request.POST.get('StoredBox')
Own1.save() #box.save()
box.save() return HttpResponse(status=501)
return JsonResponse({'box': box.toJson()})
# TODO Refaire WhereIsBox pour que ce soit récursif # TODO Refaire WhereIsBox pour que ce soit récursif
def whereIsBox(request, boxId): def whereIsBox(request, boxId):
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment