Пример #1
0
def char_search(wowrealm, wowcharacter):
    realmlist = SQLfetcher.SQLfetchRealm()
    realmlist_l = SQLfetcher.SQLfetchRealmLower()
    if (all(c.isalpha() for c in wowcharacter) and len(wowcharacter) < 13
            and len(wowcharacter) > 1 and wowrealm in realmlist_l):
        try:
            char_profile = wowdata.get_character("eu", wowrealm, wowcharacter,
                                                 "gear")
            SQLfetcher.SQLinsert(char_profile, "WEB")
            return render_template(
                "lookup.html",
                char_data=char_profile,
                realm_data=realmlist,
                color_class=css_wow_class,
                selection="lookup",
                nav=navi,
            )
        except:
            return render_template(
                "lookup.html",
                realm_data=realmlist,
                err_msg="Character not found!",
                selection="lookup",
                nav=navi,
            )
    else:
        return render_template(
            "lookup.html",
            realm_data=realmlist,
            err_msg="Invalid input!",
            selection="lookup",
            nav=navi,
        )
Пример #2
0
def char_lookup():
    realmlist = SQLfetcher.SQLfetchRealm()
    return render_template("lookup.html",
                           realm_data=realmlist,
                           selection="lookup",
                           nav=navi)