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")
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")