def editArticle(request): '''edit''' if request.method == "POST": form = editArticleForm(request.POST) if form.is_valid(): form.save() logger.info(form.cleaned_data) return HttpResponseRedirect(reverse('adminartlisturl')) else: form = editArticleForm() kwvars = { 'form' : form, 'request' : request, } return render_to_response('Article/admin.edit.article.html', kwvars, RequestContext(request))
def reEditArticle(request, artid): '''再编辑''' article = Article.objects.get(pk=int(artid)) form = editArticleForm(instance=article) kwvars = { 'form' : form, 'request' : request, } return render_to_response('Article/admin.edit.article.html', kwvars, RequestContext(request))
def editArticle(request): '''edit''' if request.method == "POST": form = editArticleForm(request.POST) if form.is_valid(): form.save() logger.info(form.cleaned_data) return HttpResponseRedirect(reverse('adminartlisturl')) else: form = editArticleForm() kwvars = { 'form': form, 'request': request, } return render_to_response('Article/admin.edit.article.html', kwvars, RequestContext(request))
def reEditArticle(request, artid): '''再编辑''' article = Article.objects.get(pk=int(artid)) form = editArticleForm(instance=article) kwvars = { 'form': form, 'request': request, } return render_to_response('Article/admin.edit.article.html', kwvars, RequestContext(request))