def cancelreserve(ID): dict = {} produceTime = Util.get_timenow() dict['type'] = 'cancel' dict['id'] = ID dict['beginTime'] = None dict['endTime'] = None dict['name'] = session["username"] dict['PlateNumber'] = None dict['time'] = Util.get_timenow() str = dumps(dict) queue.put(str) # 添加到队列里面 return render_template('wait1.html', time=ID)
def reserver(): if request.method == "POST": Time = request.form['slider_value'] beginTime, endTime = Time[6:11], Time[16:21] if endTime == "24:00": endTime = "23:59" # timeintervel = beginTime + " to " + endTime temp = request.form["picker"] + "/" + beginTime beginTime = datetime.datetime.strptime(temp, '%m/%d/%Y/%H:%M') temp = request.form["picker"] + "/" + endTime endTime = datetime.datetime.strptime(temp, '%m/%d/%Y/%H:%M') produceTime= Util.get_timenow() print produceTime dict={} dict['type'] = 'create' dict['id'] = None dict['beginTime'] = beginTime dict['endTime'] = endTime dict['name'] = session["username"] dict['PlateNumber'] = request.form["plate"] dict['time'] = produceTime # 不知道出现什么问题 str = dumps(dict) queue.put(str) # 添加到队列里面 return render_template('wait.html', time=produceTime)