예제 #1
0
파일: views.py 프로젝트: Vieceli/sonorah
def vcnosonorah(request,template_name):
    usuario=request.user
    if request.method == 'POST': 
        POST=request.POST
        print POST
        artista_form = ArtistaForm(request.POST)
        if artista_form.is_valid(): 
            artista_form.save()
            return HttpResponseRedirect('/Obrigado/')
       
    else:
        artista_form = ArtistaForm()
        
    return render_to_response(template_name, locals(), context_instance=RequestContext(request))
예제 #2
0
def artista(request,template_name, artista_slug):
    usuario=request.user
    
#    if request.method == 'GET':
#        GET = request.GET  
#        if GET.has_key('a'):  
#            form = ArtistaForm(request.GET'  
    noticia = get_object_or_404(Artista, slug=artista_slug)
    noticias_recentes = Artista.objects.all().order_by('-atualizado_em')
    
    if request.method == 'POST': 
        POST=request.POST
        print POST
        artista_form = ArtistaForm(request.POST)
        if artista_form.is_valid(): 
            artista_form.save()
            return HttpResponseRedirect('/Obrigado/')
       
    else:
        artista_form = ArtistaForm()
        
    return render_to_response(template_name, locals(), context_instance=RequestContext(request))