On Aug 23, 11:17 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> This seems to have done the trick. Thanks for your help.
>
> def index(request):
>     if request.method == 'POST':
>         form = pasteForm(request.POST)
>         if form.is_valid():
>             name = form.cleaned_data['name']
>             log = form.cleaned_data['log']
>             return HttpResponseRedirect('/success/')
>         else:
>             return render_to_response('pastebin.html', {'form': form})
>     else:
>         form = pasteForm()
>         return render_to_response('pastebin.html', {'form': form})

Why not

def index(request):
    if request.method == 'POST':
        form = pasteForm(request.POST)
        if form.is_valid():
            name = form.cleaned_data['name']
            log = form.cleaned_data['log']
            return HttpResponseRedirect('/success/')
    else:
        form = pasteForm()
    return render_to_response('pastebin.html', {'form': form})

like in the docs?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to