Ejemplo n.º 1
0
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))
Ejemplo n.º 2
0
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))
Ejemplo n.º 3
0
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))
Ejemplo n.º 4
0
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))