예제 #1
0
#!/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          |
+-----------------+-------------------------------+------+-----+---------+----------------+
예제 #2
0
    '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()
예제 #3
0
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()