コード例 #1
0
ファイル: porter_old.py プロジェクト: nchnch/Python
def _games():
    """
    Porting games from old DB
    """
    old_to_new = _old_to_new()

    c_old.execute("""SELECT id, casino_id, image_path AS screenshot, link AS info__url_play_side, 
    width AS flash_width, heigth AS flash_height, show_slot AS flash_enabled, name AS info__name,
    show_mode AS flash_inframe, order_slot AS order_hand FROM slots ORDER BY id ASC""") #show_new_window, reflink, 
    for item in c_old.fetchall():
        if not old_to_new.has_key(item["casino_id"]):
            continue

        c_new.execute("""INSERT INTO casino_game(gametype, name, screenshot, flash_width, flash_height, 
            flash_enabled, order_hand, flash_inframe, maincasino_id, order_google, param_sale, param_gambling, 
            param_demo, param_mobile, param_integrity, param_shift, param_dealer, param_multiplayer, 
            param_tele, param_jackpot, enabled, old_id) VALUES(0, %s, %s, %s, %s, %s, %s, %s, %s, 0, -1, 
            -1, 0, -1, -1, -1, -1, -1, -1, -1, false, %s) RETURNING id""", (item["info__name"], 
            item["screenshot"], item["flash_width"], item["flash_height"], item["flash_enabled"], item["order_hand"],
            ('true' if item["flash_inframe"] == "1" else 'false'), old_to_new[item["casino_id"]], item["id"]))
        new_id = c_new.fetchone()[0]

        c_new.execute("""INSERT INTO casino_gameinfo(urlkey, game_id, lang_id, name, url_play_side, 
            tags_picture, tags_theme, tags_name, selltext, url_buy_our, url_play_our, 
            url_flash, url_buy_side) VALUES(null, %s, 1, %s, %s, '', '', '', '', null, null, null, null)""", 
            (new_id, item["info__name"], item["info__url_play_side"]))
    conn_new.commit()
コード例 #2
0
ファイル: porter_old.py プロジェクト: nchnch/Python
def __casino():
    """
    Porting casino
    """
    c_old.execute("""SELECT id, casino_name AS name, casino_domain AS domain, path AS purl_main,
    description, article AS text, logo AS image FROM managers_sites ORDER BY id ASC""")

    for item in c_old.fetchall():
        casino_name = item["name"] if item["name"] else item["domain"]
        c_new.execute("""INSERT INTO casino_casino(name, domain, param_mobile, param_download, param_browser, 
        param_audited, param_integrity, param_license, param_jackpot, param_tournaments, 
        param_nodepositbonus, old_id, param_shift, param_dealer, param_multiplayer, 
        similar_sale, urlkey, status, link_similar_sale, order_google, order_hand, enabled, relation) 
        VALUES(%s, %s, -1, -1, -1, -1, -1, -1, -1, -1, -1, %s, -1, -1, -1, false, '', 1, '', 0, 0, false, 1) 
        RETURNING id""", (casino_name, item["domain"], item["id"]))
        new_id = c_new.fetchone()[0]

        item_image = item["image"] if item["image"] else ""
        c_new.execute("""INSERT INTO casino_casinoinfo(casino_id, lang_id, name, image, description, 
        purl_main, purl_download, purl_bonus) VALUES(%s, 1, %s, %s, %s, %s, '', '')""", 
        (new_id, item["name"], item_image, item["description"], item["purl_main"]))
        # c_new.execute("""INSERT INTO casino_casinoinfo(casino_id, lang_id, name, image, description, 
        # text, purl_main, purl_download, purl_bonus) VALUES(%s, 1, %s, %s, %s, %s, %s, '', '')""", 
        # (new_id, item["name"], item_image, item["description"], item["text"], item["purl_main"]))
    conn_new.commit()