示例#1
0
def rePostArticle(req):
    '''
    获取被修改的文章id
    '''
    userid = req.session.get('userid')
    password = req.session.get('password')
    articleid = req.POST.get('article_id')
    '''
    获取修改后的标题,内容,照片
    '''
    title = req.POST.get('title')
    content = req.POST.get('content')
    from utils.getPicId import getPic
    photos = getPic(content)
    result = actions.rePostArticle(userid, password, articleid, title, photos, content)
    return HttpResponse(result)
示例#2
0
def save(req):
    userid = req.session.get('userid')
    password = req.session.get('password')
    if req.method == 'POST':
        title = req.POST.get('title')
        content = req.POST.get('content')
        from utils.getPicId import getPic
        photos = getPic(content)
        print photos, type(photos)
        result = actions.save(userid, password, title, photos, content)
        resultJson = json.loads(result)
        if resultJson.get('done') == True:
            result = json.dumps({"done": True})
        else:
            result = json.dumps({"done": False})
        return HttpResponse(result)