Exemple #1
0
from server.db import connection_pool
import traceback

ALLIEDELEC_CONN = connection_pool.get_mysql_conn('mysql_alliedelec')


class LieBrand(dict):
    brand_name = ''
    brand_logo = ''
    brand_desc = ''
    site_url = ''
    web_url = ''
    sort_order = ''
    is_show = ''

    @classmethod
    def addLieBrand(cls, lieBrand):
        '''
        method: addLieBrand
        params:
            lieBrand-type: LieBrand
        '''
        global ALLIEDELEC_CONN
        cursor = None
        try:
            cursor = ALLIEDELEC_CONN.cursor(buffered=True, dictionary=True)
            sql = ("insert into lie_brand(brand_name, brand_logo, brand_desc,"
                   "site_url, web_url) "
                   "values(%(brand_name)s,%(brand_logo)s,%(brand_desc)s,"
                   "%(site_url)s, %(web_url)s)")
            cursor.execute(sql, lieBrand)
Exemple #2
0
from server.db import connection_pool
import traceback

VERICAL_CONN = connection_pool.get_mysql_conn('mysql_verical')


class LieBrand(dict):
    brand_name = ''
    brand_logo = ''
    brand_desc = ''
    site_url = ''
    web_url = ''
    sort_order = ''
    is_show = ''

    @classmethod
    def addLieBrand(cls, lieBrand):
        '''
        method: addLieBrand
        params:
            lieBrand-type: LieBrand
        '''
        global VERICAL_CONN
        cursor = None
        try:
            cursor = VERICAL_CONN.cursor(buffered=True, dictionary=True)
            sql = ("insert into lie_brand(brand_name, brand_logo, brand_desc,"
                   "site_url, web_url) "
                   "values(%(brand_name)s,%(brand_logo)s,%(brand_desc)s,"
                   "%(site_url)s, %(web_url)s)")
            cursor.execute(sql, lieBrand)
Exemple #3
0
from server.db import connection_pool

AVNET_CONN = connection_pool.get_mysql_conn('mysql_avnet')


class LieBrand(dict):
    brand_name = ''
    brand_logo = ''
    brand_desc = ''
    site_url = ''
    web_url = ''
    sort_order = ''
    is_show = ''

    @classmethod
    def addLieBrand(cls, lieBrand):
        '''
        method: addLieBrand
        params:
            lieBrand-type: LieBrand
        '''
        global AVNET_CONN
        cursor = None
        try:
            cursor = AVNET_CONN.cursor(buffered=True, dictionary=True)
            sql = ("insert into lie_brand(brand_name, brand_logo, brand_desc,"
                   "site_url, web_url) "
                   "values(%(brand_name)s,%(brand_logo)s,%(brand_desc)s,"
                   "%(site_url)s, %(web_url)s)")
            cursor.execute(sql, lieBrand)
        except Exception as e:
from server.db import connection_pool
import hashlib
from unittest import TestCase, main 

COMPANY_CONN = connection_pool.get_mysql_conn('mysql_company')

class LieBrand(dict):
    brand_name = ''
    brand_desc = ''
    site_url = ''

    @classmethod
    def addLieBrand(cls, lieBrand):
        '''
        method: addBrand
        params:
            lieBrand-type: LieBrand
        '''
        global COMPANY_CONN
        cursor = None
        try:
            cursor = COMPANY_CONN.cursor(buffered=True, dictionary=True)
            sql = ("insert into lie_brand(brand_name, brand_desc, site_url)"
                   "values(%(brand_name)s, %(brand_desc)s, %(site_url)s)")
            cursor.execute(sql, lieBrand)
            COMPANY_CONN.commit()
        except Exception as e:
            print(e)
            COMPANY_CONN.rollback()
            return None
        finally:
from server.db import connection_pool

DIGIKEY_CONN = connection_pool.get_mysql_conn('mysql_digikey')

class LieBrand(dict):
    brand_name = ''
    brand_logo = ''
    brand_desc = ''
    site_url = ''
    web_url = ''
    sort_order = ''
    is_show = ''

    @classmethod
    def addLieBrand(cls, lieBrand):
        '''
        method: addLieBrand
        params:
            lieBrand-type: LieBrand
        '''
        global DIGIKEY_CONN
        cursor = None
        try:
            cursor = DIGIKEY_CONN.cursor(buffered=True, dictionary=True)
            sql = ("insert into lie_brand(brand_name, brand_logo, brand_desc,"
                    "site_url, web_url) "
                    "values(%(brand_name)s,%(brand_logo)s,%(brand_desc)s,"
                    "%(site_url)s, %(web_url)s)")
            cursor.execute(sql, lieBrand)
        except Exception as e:
            print(e)
Exemple #6
0
from server.db import connection_pool
import traceback

rsonline_CONN = connection_pool.get_mysql_conn('mysql_rsonline')

class LieBrand(dict):
    brand_name = ''
    brand_logo = ''
    brand_desc = ''
    site_url = ''
    web_url = ''
    sort_order = ''
    is_show = ''

    @classmethod
    def addLieBrand(cls, lieBrand):
        '''
        method: addLieBrand
        params:
            lieBrand-type: LieBrand
        '''
        global rsonline_CONN
        cursor = None
        try:
            cursor = rsonline_CONN.cursor(buffered=True, dictionary=True)
            sql = ("insert into lie_brand(brand_name, brand_logo, brand_desc,"
                    "site_url, web_url) "
                    "values(%(brand_name)s,%(brand_logo)s,%(brand_desc)s,"
                    "%(site_url)s, %(web_url)s)")
            cursor.execute(sql, lieBrand)
        except Exception as e: