Ejemplo n.º 1
0
def handle_new_tread(request):
    #lib.utils.get_board_name_from_referer(request['HTTP_REFERER'])
    request.POST["pname"] = wakaba(strip_tags(request.POST["pname"]))
    request.POST["pmail"] = wakaba(strip_tags(request.POST["pmail"]))
    request.POST["ptitle"] = wakaba(strip_tags(request.POST["ptitle"]))
    request.POST["ppost"] = wakaba(strip_tags(request.POST["ppost"]))
    model = models.Model()
    if request.POST["pname"] == '':
        request.POST["pname"] = "Anonymous"

    NewRecord = models.get_simple_record(name=request.POST["pname"],
                                         email=request.POST["pmail"],
                                         title=request.POST["ptitle"],
                                         post=request.POST["ppost"])
    MyBoard = models.get_simple_board(
        adr=lib.utils.get_board_name_from_referer(request['HTTP_REFERER']))
    model.add_new_tread_to_board_by_record(NewRecord, MyBoard)
    newstr = str(lib.utils.get_board_name_from_referer(
        request['HTTP_REFERER'])) + ", " + str(request.POST["pname"])
    con = {
        "lol": newstr,
        "boardname":
        lib.utils.get_board_name_from_referer(request['HTTP_REFERER'])
    }
    return HttpResponse(Template('treadcreated.html').render(Context(con)))
Ejemplo n.º 2
0
def handle_new_record(request):
    model = models.Model()
    request.POST["pname"] = wakaba(strip_tags(request.POST["pname"]))
    request.POST["pmail"] = wakaba(strip_tags(request.POST["pmail"]))
    request.POST["ptitle"] = wakaba(strip_tags(request.POST["ptitle"]))
    request.POST["ppost"] = wakaba(strip_tags(request.POST["ppost"]))
    if request.POST["pname"] == '':
        request.POST["pname"] = "Anonymous"
    NewRecord = models.get_simple_record(name=request.POST["pname"],
                                         email=request.POST["pmail"],
                                         title=request.POST["ptitle"],
                                         post=request.POST["ppost"])
    MyBoard = models.get_simple_board(adr=request.POST["boardadr"])
    MyTread = model.get_tread_by_id(request.POST["treadid"], MyBoard)

    model.insert_record_into(MyTread, NewRecord, MyBoard)

    newstr = str(request.POST["boardadr"]) + ", в треде " + str(
        request.POST["treadid"]) + ", " + str(request.POST["pname"])
    con = {
        "lol": newstr,
        "treadname": request.POST["treadid"],
        "boardname": request.POST["boardadr"]
    }
    return HttpResponse(Template('recordcreated.html').render(Context(con)))
Ejemplo n.º 3
0
def handle_new_tread(request):
    #lib.utils.get_board_name_from_referer(request['HTTP_REFERER'])
    request.POST["pname"] = wakaba(strip_tags(request.POST["pname"]))
    request.POST["pmail"] = wakaba(strip_tags(request.POST["pmail"]))
    request.POST["ptitle"] = wakaba(strip_tags(request.POST["ptitle"]))
    request.POST["ppost"] = wakaba(strip_tags(request.POST["ppost"]))
    model = models.Model()
    if request.POST["pname"]=='':
        request.POST["pname"]="Anonymous" 
        
    NewRecord = models.get_simple_record(name = request.POST["pname"], email = request.POST["pmail"],
                                          title = request.POST["ptitle"],post = request.POST["ppost"])
    MyBoard = models.get_simple_board(adr = lib.utils.get_board_name_from_referer(request['HTTP_REFERER']))
    model.add_new_tread_to_board_by_record(NewRecord, MyBoard)
    newstr = str(lib.utils.get_board_name_from_referer(request['HTTP_REFERER']))+ ", "+str(request.POST["pname"])
    con = {"lol": newstr, "boardname": lib.utils.get_board_name_from_referer(request['HTTP_REFERER'])}
    return HttpResponse(Template('treadcreated.html').render(Context(con)))
Ejemplo n.º 4
0
def handle_new_record(request):
    model = models.Model()
    request.POST["pname"] = wakaba(strip_tags(request.POST["pname"]))
    request.POST["pmail"] = wakaba(strip_tags(request.POST["pmail"]))
    request.POST["ptitle"] = wakaba(strip_tags(request.POST["ptitle"]))
    request.POST["ppost"] = wakaba(strip_tags(request.POST["ppost"]))
    if request.POST["pname"]=='':
        request.POST["pname"]="Anonymous" 
    NewRecord = models.get_simple_record(name = request.POST["pname"], email = request.POST["pmail"],
                                          title = request.POST["ptitle"],post = request.POST["ppost"])
    MyBoard = models.get_simple_board(adr = request.POST["boardadr"])
    MyTread = model.get_tread_by_id(request.POST["treadid"], MyBoard)
    
    model.insert_record_into(MyTread, NewRecord, MyBoard)
    
    newstr = str(request.POST["boardadr"])+ ", в треде "+ str(request.POST["treadid"])+", "+str(request.POST["pname"])
    con = {"lol": newstr, "treadname": request.POST["treadid"] , "boardname": request.POST["boardadr"]}
    return HttpResponse(Template('recordcreated.html').render(Context(con)))
Ejemplo n.º 5
0
def head(request):
    if request.method == 'GET':
        st = 'GET = ' + str(request.GET) + '<br>'
    else:
        st = 'POST = ' + str(request.POST) + '<br>'

    st += wakaba(strip_tags(request.POST['post'])) + '<br>'
    for name in request:
        st += name + ': ' + str(request[name]) + '<br>'
    return HttpResponse(st)
Ejemplo n.º 6
0
def head(request):
    if request.method == 'GET':
        st = 'GET = ' + str(request.GET) + '<br>'
    else:
        st = 'POST = ' + str(request.POST) + '<br>'

    st += wakaba(strip_tags(request.POST['post'])) + '<br>'
    for name in request:
        st += name + ': ' + str(request[name]) + '<br>'
    return HttpResponse(st)