#!/usr/bin/python3 import mysql.connector from datetime import datetime from migration_common import client_country_mapping, em, lgc_5_connect, lgc_4_1_connect import pdb print('importing invoices...') try: lgc_4_1 = lgc_4_1_connect() lgc_v5 = lgc_5_connect() lgc_4_1_fp = lgc_4_1_connect() lgc_4_1_p = lgc_4_1_connect() lgc_4_1_c = lgc_4_1_connect() lgc_v5 = lgc_5_connect() except Exception as e: print(e) print('exiting...') exit() cursor4 = lgc_4_1.cursor() cursor_fp = lgc_4_1_fp.cursor() cursor_p = lgc_4_1_p.cursor() cursor_c = lgc_4_1_c.cursor() cursor5 = lgc_v5.cursor() """ mysql> desc facture; +-----------------+-------------------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------------+-------------------------------+------+-----+---------+----------------+
'vietnamieene':'VN', 'vietnamien':'VN', 'vietnamienne':'VN', 'yemenite':'YE', 'zimbabwéenne':'ZW', 'égyptien':'EG', 'égyptiene':'EG', 'étasunienne':'US', 'états-unienne':'US', 'étatstunienne':'US', 'étatsunienne':'US', 'étatsunnienne':'US', } try: lgc_4_1 = lgc_4_1_connect() lgc_v5 = lgc_5_connect() except Exception as e: print(e) print('exiting...') exit() cursor4 = lgc_4_1.cursor() cursor5 = lgc_v5.cursor() cursor4.execute("SELECT * FROM personne") now = datetime.now() formatted_date = now.strftime('%Y-%m-%d %H:%M:%S') row = cursor4.fetchone()
import mysql.connector from datetime import datetime from migration_common import lgc_5_connect, lgc_4_1_connect import pdb, os, sys, django sys.path.append("..") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lgc_base.settings") django.setup() from lgc.models import Invoice import logging print('importing items...') try: lgc_4_1 = lgc_4_1_connect() lgc_4_1_tarif = lgc_4_1_connect() lgc_v5 = lgc_5_connect() lgc_v5_invoice = lgc_5_connect() except Exception as e: print(e) print('exiting...') exit() cursor4 = lgc_4_1.cursor() cursor4_tarif = lgc_4_1_tarif.cursor() cursor5 = lgc_v5.cursor() cursor5_invoice = lgc_v5_invoice.cursor() cursor4.execute("SELECT * FROM diligence") row = cursor4.fetchone()