it would seem that the form still have some errors, try outputting
form.errors in the template to see if its empty

On 3/2/07, johnny <[EMAIL PROTECTED]> wrote:
>
> When I submit the information with the form, for some reason, I keep
> coming back to the form, with data I entered.  I am not sure why this
> is the case.  It should take the data, and save to the file.
>
> def add_post(request):
>     if request.method == 'POST':
>         form = forms.postForm(request.POST)
>         if form.is_valid():
>             new_post= Post(
>                         title = form.clean_data['title'],
>                         description = form.clean_data['description'],
>                         created_at =
> datetime.utcnow(),
>                         )
>
>             new_post.save()
>             return HttpResponseRedirect(new_post.get_absolute_url())
>     else:
>         form = forms.postForm()
>     return render_to_response('post/post_add.html',
>                               { 'form': form,
>                               'html_head': '<script src="/site_media/
> js/tiny_mce/tiny_mce_src.js" type="text/javascript"></script>'
>                               },
>                               context_instance=RequestContext(request))
>
>
> >
>


-- 
Honza Kr�l
E-Mail: [EMAIL PROTECTED]
ICQ#:   107471613
Phone:  +420 606 678585

--~--~---------~--~----~------------~-------~--~----~
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