예제 #1
0
def add_bike():
    if request.method == "GET":
        return render_template("add_bike.html")
    if request.method == "POST":
        form = request.form
        bikename = form["bikename"]
        hangxe = form["hangxe"]
        image = form["image"]
        dongco = form["dongco"]
        maluc = form["maluc"]
        hopso = form["hopso"]
        chieucaoyenxe = form["chieucaoyenxe"]
        dacdiemkhac = form["dacdiemkhac"]
        giaxe = form["giaxe"]
        superbike = Bike(bikename=bikename,
                         hangxe=hangxe,
                         image=image,
                         dongco=dongco,
                         maluc=maluc,
                         hopso=hopso,
                         chieucaoyenxe=chieucaoyenxe,
                         dacdiemkhac=dacdiemkhac,
                         giaxe=giaxe)
        superbike.save()
        return render_template("add_bike.html")
예제 #2
0
파일: app.py 프로젝트: Nguyenmduc2000/b-ke
def thongso(brand, name):

    if request.method == "GET":
        info = Bike.objects(bikename=name)
        return render_template("thongso.html",
                               hangxe=brand,
                               dongxe=name,
                               info=info)
    if request.method == "POST":
        return render_template("homepage.html")
예제 #3
0
파일: app.py 프로젝트: Nguyenmduc2000/b-ke
def search(search_name):
    print(search_name)
    bikes = Bike.objects(hangxe__icontains=search_name)
    print(bikes)
    return redirect("<brand>/<search_name>")
예제 #4
0
파일: app.py 프로젝트: Nguyenmduc2000/b-ke
def phankhuc(brand):
    if request.method == "GET":
        bikes = Bike.objects(hangxe=brand)
        return render_template("phankhuc.html", hangxe=brand, bikes=bikes)
    if request.method == "POST":
        return render_template("homepage.html")
예제 #5
0
def thongso(brand,name):
  info = Bike.objects(bikename=name)
  return render_template("thongso.html", hangxe = brand, dongxe = name, info = info)
예제 #6
0
def phankhuc(brand):
  bikes = Bike.objects(hangxe=brand)
  return render_template("phankhuc.html",hangxe=brand, bikes = bikes)