diff --git a/back/transfer_bdd/v0.0...v1.0/create_bdd.py b/back/transfer_bdd/v0.0...v1.0/create_bdd.py index ececc56..c577c64 100755 --- a/back/transfer_bdd/v0.0...v1.0/create_bdd.py +++ b/back/transfer_bdd/v0.0...v1.0/create_bdd.py @@ -15,7 +15,7 @@ import os import random import copy from dateutil import parser - +data_mapping = {} print(" =================================================== Send DATA "); import transfert_data data_mapping = transfert_data.transfert_db() @@ -28,9 +28,9 @@ group_mapping = transfert_group.transfert_db(data_mapping, type_mapping) print(" =================================================== Send SAISON "); import transfert_saison saison_mapping = transfert_saison.transfert_db(data_mapping, type_mapping, group_mapping) -#print(" =================================================== Send UNIVERS "); -#import transfert_univers -#univers_mapping = transfert_univers.transfert_db(data_mapping, type_mapping, group_mapping) +##print(" =================================================== Send UNIVERS "); +##import transfert_univers +##univers_mapping = transfert_univers.transfert_db(data_mapping, type_mapping, group_mapping) print(" =================================================== Send Medias "); import transfert_video video_mapping = transfert_video.transfert_db(data_mapping, type_mapping, group_mapping, saison_mapping) diff --git a/back/transfer_bdd/v0.0...v1.0/transfert_type.py b/back/transfer_bdd/v0.0...v1.0/transfert_type.py index c350a7a..5e68393 100755 --- a/back/transfer_bdd/v0.0...v1.0/transfert_type.py +++ b/back/transfer_bdd/v0.0...v1.0/transfert_type.py @@ -45,11 +45,17 @@ def transfert_db(data_mapping): iii = 0; for elem in my_old_bdd: iii+=1; - debug.info("[" + str(iii) + "/" + str(len(my_old_bdd)) + "] send new element " + str(elem["id"])) + debug.info("[" + str(iii) + "/" + str(len(my_old_bdd)) + "] ??? Get element " + str(elem["id"]) + " with name: '" + elem["name"] + "'") id = elem["id"] name = elem["name"] - request_insert = (name) - c.execute('SELECT id FROM node WHERE type = \'type\' LIMIT 1', request_insert) + if name == 'Short Films': + name = 'Short movie' + if name == 'tv show': + name = 'TV show' + if name == 'Anniation tv show': + name = 'Anniation TV show' + request_insert = (name,) + c.execute("SELECT id FROM node WHERE type = 'type' AND name = %s LIMIT 1", request_insert) id_of_new_row = c.fetchone()[0] debug.info("data transform: " + str(id) + " => " + str(id_of_new_row)) out[str(id)] = id_of_new_row