示例#1
0
def write(request):
    title = request.POST['title']
    contents = request.POST['contents']
    authuser = request.session.get('authuser')
    user_no = authuser['no']
    boardmodel.insert(title, contents, '0', '1', '1', '0', user_no)  # title, contents, hit, g_no, o_no, depth, user_no
    return HttpResponseRedirect('/board')
示例#2
0
def write(request):
    title = request.POST['title']
    content = request.POST['content']
    no = request.session['authuser']['no']

    boardmodels.insert(title, content, no)
    return HttpResponseRedirect('/board')
示例#3
0
文件: views.py 项目: datstar2/mysite
def write(request):
    title = request.POST['title']
    content = request.POST['content']
    user_no = request.session['auth']['no']
    boardmodel.insert(title, content, user_no)
    no = boardmodel.maxno()
    gno = boardmodel.maxg_no()
    boardmodel.g_noplus(gno, no)
    return HttpResponseRedirect('/board?page=1')
示例#4
0
def add(request):
    user_no = request.session['userauth']['no']
    title = request.POST['title']
    content = request.POST['content']

    max_group_dict = boardmodel.get_max_group_no()  # 10s

    boardmodel.insert(title, content, max_group_dict['max'], user_no)

    return HttpResponseRedirect('/board')
示例#5
0
def write(request):
    title = request.POST['title']
    contents = request.POST['content']
    user_no = request.GET['no']
    g_no = models.find_max_g_no()
    if g_no is None:
        g_no = 1

    models.insert(title, contents, g_no, user_no)

    return HttpResponseRedirect('/board')
示例#6
0
def add(request):


    title = request.POST['title']
    content = request.POST['content']
    authuser = request.session['authuser']
    authid = authuser['name']

    models.insert(( title, content, authid))

    return HttpResponseRedirect('/board')
示例#7
0
文件: views.py 项目: datstar2/mysite
def reply(request):
    try:
        g_no = request.POST['g_no']
        o_no = str(int(request.POST['o_no'])+1)
        depth = str(int(request.POST['depth'])+1)
        title = request.POST['title']
        content = request.POST['content']
        user_no = request.session['auth']['no']
        boardmodel.insert(title, content, user_no)
        no = boardmodel.maxno()
        boardmodel.updatereply(g_no, o_no, depth, no)
        boardmodel.neworder(g_no, o_no, no)
        return HttpResponseRedirect('/board?page=1')
    except KeyError as e:
        return HttpResponseRedirect('/board?page=1')
示例#8
0
def write(request):
    title = request.POST['title']
    content = request.POST['content']

    models.insert(title, contents)
    return render(request, 'board/write.html')