Ejemplo n.º 1
0
def cc_codesearch():

    form = CodeSearchForm(request.form)

    if not form.validate():
        return render_template("colorcode/listwdelete.html", form = form, error = "Invalid code")

    return render_template("colorcode/listwdelete.html", items = Cc_ptype.codesearch_cc(form.incl.data, form.search.data), form = CodeSearchForm())
Ejemplo n.º 2
0
def item_codesearch():

    form = CodeSearchForm(request.form)

    if not form.validate():
        return render_template("items/listpersonal.html",
                               form=form,
                               error="Invalid code")

    return render_template("items/listpersonal.html",
                           items=Item.codesearch(str(current_user.id),
                                                 form.incl.data,
                                                 form.search.data),
                           form=CodeSearchForm())
Ejemplo n.º 3
0
def items_date_added():
    return render_template("items/listpersonal.html",
                           items=Item.date_added(Item, str(current_user.id)),
                           form=CodeSearchForm())
Ejemplo n.º 4
0
def items_favorite():
    return render_template("items/listpersonal.html",
                           items=Item.find_favorite(Item,
                                                    str(current_user.id)),
                           form=CodeSearchForm())
Ejemplo n.º 5
0
def items_myindex():
    return render_template("items/listpersonal.html",
                           items=Item.personal_index(Item,
                                                     str(current_user.id)),
                           form=CodeSearchForm())
Ejemplo n.º 6
0
def most_popular_cc():
    return render_template("colorcode/listwdelete.html", items = Colorcode.most_popular_cc(), form = CodeSearchForm())
Ejemplo n.º 7
0
def ptype_only():
    if current_user.is_authenticated:
        if "ADMIN" in current_user.roles():
            return render_template("colorcode/listwdelete.html", items = Ptype.ptype_iterable(), form = CodeSearchForm())
    return render_template("colorcode/listccptype.html", items = Ptype.ptype_iterable(), form = CodeSearchForm())
Ejemplo n.º 8
0
def cc_only():
    if current_user.is_authenticated:
        if "ADMIN" in current_user.roles():
            print("------IS ADMIN!")
            return render_template("colorcode/listwdelete.html", items = Colorcode.cc_iterable(), form = CodeSearchForm())
    
    return render_template("colorcode/listccptype.html", items = Colorcode.cc_iterable(), form = CodeSearchForm())
Ejemplo n.º 9
0
def cc_ptype_index():
        return render_template("colorcode/list.html", items = Cc_ptype.list_products(), form = CodeSearchForm())