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))
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---