def command(request): if request.method == 'POST': _command=request.POST.get('command', 'boo') _parameter=request.POST.get('parameter',0) _quantity=request.POST.get('quantity',0) myCommand = Command(command=_command, statusTimeStamp=timezone.now(), parameter=_parameter, quantity=_quantity, status='queued', commandTimeStamp=timezone.now()) myCommand.json=jsonTranslation(myCommand) if myCommand.command=="placePanel": myCommand.description=buildDescription(myCommand) myCommand.save() return HttpResponse("yo") else: return HttpResponse("bite me")
def command(request): if request.method == 'POST': _command = request.POST.get('command', 'boo') _parameter = request.POST.get('parameter', 0) _quantity = request.POST.get('quantity', 0) myCommand = Command(command=_command, statusTimeStamp=timezone.now(), parameter=_parameter, quantity=_quantity, status='queued', commandTimeStamp=timezone.now()) myCommand.json = jsonTranslation(myCommand) if myCommand.command == "placePanel": myCommand.description = buildDescription(myCommand) myCommand.save() return HttpResponse("yo") else: return HttpResponse("bite me")
def command(request): if request.method == "POST": _command = request.POST.get("command", "boo") _parameter = request.POST.get("parameter", 0) _quantity = request.POST.get("quantity", 0) myCommand = Command( command=_command, statusTimeStamp=timezone.now(), parameter=_parameter, quantity=_quantity, status="queued", commandTimeStamp=timezone.now(), ) myCommand.json = jsonTranslation(myCommand) if myCommand.command == "placePanel": myCommand.description = buildDescription(myCommand) myCommand.save() return HttpResponse("yo") else: return HttpResponse("bite me")