예제 #1
0
def adicionaClube(request):
    if request.method == "POST":
        form = FormClube(request.POST, request.FILES)
        if form.is_valid():
            form.save()
            return render_to_response("mensagens/salvo.html", {})
        pass
    else:            
        form = FormClube()
    
    return render_to_response("novoClube.html", {"form": form},
                        context_instance = RequestContext(request))
예제 #2
0
def infoClube(request, nr_clube):
    clube = get_object_or_404(Clube, pk=nr_clube)
    
    if request.method == "POST":
        form = FormClube(request.POST, request.FILES, instance=clube)
        
        if form.is_valid():
            clube = form.save(commit=False)
            #clube.usuario = request.user
            clube.save()
            return render_to_response("mensagens/salvo.html", {})        
    else:
        form = FormClube(instance=clube)   
    
    return render_to_response("infoClube.html",{'form': form},
                    context_instance=RequestContext(request))