代码语言:javascript复制
def updatexxxs(request):
"""更新信息"""
systemDict = {}
for key in request.POST:
systemDict[key] = request.POST.get(key)
print(systemDict)
try:
Employee.objects.filter(username=systemDict['username']).update(**systemDict)
data = {
"code": 200,
"msg": '更新成功'
}
resp = JsonResponse(data)
return resp
except:
data = {
"code": 400,
"msg": '更新失败'
}
resp = JsonResponse(data)
return resp