예제 #1
0
파일: views.py 프로젝트: thaisbarras/dimel
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})
예제 #2
0
파일: views.py 프로젝트: thaisbarras/dimel
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))