Re: newform: Post_add Submission not working
On 3/3/07, johnny <[EMAIL PROTECTED]> wrote: > > I did place form.errors in the template. If I type the invalid data, > then it displays the errors. Problem is when I type in valid data, it > doesn't display anything and brings me back to the form with the data > I have entered. Every frustrating problem. without more information, nobody will be able to help you... you can try working with the form from command line to see what's going wrong... > > > > > -- 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 -~--~~~~--~~--~--~---
Re: newform: Post_add Submission not working
I did place form.errors in the template. If I type the invalid data, then it displays the errors. Problem is when I type in valid data, it doesn't display anything and brings me back to the form with the data I have entered. Every frustrating problem. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: newform: Post_add Submission not working
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': '' > }, > 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 -~--~~~~--~~--~--~---
newform: Post_add Submission not working
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': '' }, context_instance=RequestContext(request)) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
newform: Post_add Submission not working
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': '' }, context_instance=RequestContext(request)) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---