[DEV] last transfert vertion ... and after ==> remove ...
This commit is contained in:
parent
0d8a0c20a3
commit
b8e80bbf1f
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user