def verificacao_detail(request, pk): item = get_object_or_404(VerificacaoCadAdm, pk=pk) form = PreliminaresInspecaoForm(request.POST or None, request.FILES or None, instance=item) if form.is_valid(): form.save() return HttpResponseRedirect("/verificacoes") return render(request, "bands/verificacao_detail.html", {'form': form})
def adiciona_verificacao(request): if request.method == "POST": form = PreliminaresInspecaoForm(request.POST, request.FILES) if form.is_valid(): form.save() return render_to_response("bands/verificacao_confirm.html") else: form = PreliminaresInspecaoForm() return render_to_response("bands/verificacao_adiciona.html", {'form': form}, context_instance=RequestContext(request))