示例#1
0
def modificar_user(request, id):
    ver = get_object_or_404(Usuario, id=id)
    if request.is_ajax():
        form = UsuarioForm(instance=ver)
        if form.is_valid():
            form.save()
    return HttpResponse(json.dumps("updated"), mimetype="application/json")
示例#2
0
文件: views.py 项目: CARocha/DJquery
def modificar_user(request, id):
	ver = get_object_or_404(Usuario, id=id)
	if request.is_ajax():
		form = UsuarioForm(instance=ver)
		if form.is_valid():
			form.save()
	return HttpResponse(json.dumps("updated"),
                	mimetype="application/json")
示例#3
0
文件: views.py 项目: CARocha/DJquery
def guardar_user(request):
	if request.is_ajax():
		form = UsuarioForm(request.POST)
		if form.is_valid():
			form.save()
			return HttpResponse(json.dumps("exito"),
                							mimetype="application/json")
		else:
			return HttpResponse(json.dumps("errores"),
                							mimetype="application/json")
示例#4
0
def guardar_user(request):
    if request.is_ajax():
        form = UsuarioForm(request.POST)
        if form.is_valid():
            form.save()
            return HttpResponse(json.dumps("exito"),
                                mimetype="application/json")
        else:
            return HttpResponse(json.dumps("errores"),
                                mimetype="application/json")