def tranedit(request): myValue = request.POST["value"].encode("utf-8") myValuelist = functions.fmwConvertList(myValue, '\n') myValuelist2 = [ functions.fmwConvertList(x, '\t') for x in myValuelist] myValuelist2.pop(0) #标题 myNewValue = functions.fmw2Htmltable(myValuelist2) return HttpResponse(myNewValue)
def tranedit(request): myValue = request.POST["value"].encode("utf-8") myValuelist = functions.fmwConvertList(myValue, '\n') myValuelist2 = [functions.fmwConvertList(x, '\t') for x in myValuelist] myValuelist2.pop(0) #标题 myNewValue = functions.fmw2Htmltable(myValuelist2) return HttpResponse(myNewValue)
def save_checkAdvMaxMin(request): fmdata = simplejson.loads(request.POST["myjson"]) fmdatatag = fmdata["tag"] fmdatalist = functions.fmwConvertList(fmdata["table"].encode("utf-8"), '\n') fmdatalist2 = [functions.fmwConvertList(x, '\t') for x in fmdatalist] fmdatalist2.pop(0) tag_fmdata = [x for x in fmdatalist2 if x[0] == "1"] notag_fmdata = [x for x in fmdatalist2 if x[0] == "0"] if fmdatatag == 'del': setadvMaxMin(tag_fmdata) myNewValue = functions.fmw2Htmltable(notag_fmdata) elif fmdatatag == 'save': updateMaxMin(tag_fmdata) tag_fmdata2 = [x + ["数据已保存"] for x in tag_fmdata] myNewValue = functions.fmw2Htmltable(tag_fmdata2 + notag_fmdata) #myNewValue = str(tag_fmdata2) else: myNewValue = functions.fmw2Htmltable([]) return HttpResponse(myNewValue)
def save_checkAdvMaxMin(request): fmdata = simplejson.loads(request.POST["myjson"]) fmdatatag = fmdata["tag"] fmdatalist= functions.fmwConvertList(fmdata["table"].encode("utf-8"), '\n') fmdatalist2 = [ functions.fmwConvertList(x, '\t') for x in fmdatalist] fmdatalist2.pop(0) tag_fmdata = [ x for x in fmdatalist2 if x[0] =="1"] notag_fmdata = [ x for x in fmdatalist2 if x[0] =="0"] if fmdatatag == 'del': setadvMaxMin(tag_fmdata) myNewValue = functions.fmw2Htmltable(notag_fmdata) elif fmdatatag == 'save': updateMaxMin(tag_fmdata) tag_fmdata2 = [ x + ["数据已保存"] for x in tag_fmdata] myNewValue = functions.fmw2Htmltable(tag_fmdata2+notag_fmdata) #myNewValue = str(tag_fmdata2) else: myNewValue = functions.fmw2Htmltable([]) return HttpResponse(myNewValue)