def connection(request): connection_address = request.POST['address'] connection_elevators = request.POST['elevators'] connection_floors = request.POST['floors'] row2 = ElevatorPosition.objects.all() row2.delete(); d = ElevatorPosition(E0='0', E1='0', E2='0', E3='0', E4='0', E5='0', E6='0', E7='0', E8='0', E9='0'); d.save(); p = ConnectionSetup(address=connection_address, elevators=connection_elevators, floors=connection_floors, date=datetime.datetime.now()); p.save(); return HttpResponse("Connection has been setup.")
def elevatorpositiondb(request): row2 = ElevatorPosition.objects.all() row2.delete(); E0 = request.POST['E0'] E1 = request.POST['E1'] E2 = request.POST['E2'] E3 = request.POST['E3'] E4 = request.POST['E4'] E5 = request.POST['E5'] E6 = request.POST['E6'] E7 = request.POST['E7'] E8 = request.POST['E8'] E9 = request.POST['E9'] p = ElevatorPosition(E0=E0, E1=E1, E2=E2, E3=E3, E4=E4, E5=E5, E6=E6, E7=E7, E8=E8, E9=E9); p.save(); return HttpResponse("Elevator Status has been updated.")