def post(self,request,num): postForm = PostForm(request.POST) if postForm.is_valid(): post = Post.objects.filter(pk=num).update(title=request.POST["title"],content=request.POST["content"]) return redirect('/admin/posts/') else: return redirect('/admin/posts/%s' % (num,))
def post(self,request): postForm = PostForm(request.POST) if postForm.is_valid(): post = postForm.save(commit=False) post.date = datetime.datetime.utcnow().replace(tzinfo=utc) post.save() return redirect('/admin/posts/') else: return render_to_response('postDetail.html',{"form":postForm},context_instance=RequestContext(request))