Exemplo n.º 1
0
def turn_want(want):
    local_db = db.get_dev_blue_db('blue')
    cursor = local_db.cursor()
    want_arr = str(want).split("+")
    want_str = ''
    for w in want_arr:
        want_str += "'" + w + "',"
    want_str = want_str[0:len(want_str) - 1]
    want_sql = '''select code from common_config where name in (%s) ''' % want_str
    cursor.execute(want_sql)
    codes = cursor.fetchall()
    return codes
Exemplo n.º 2
0
def create():
    blue_db = db.get_dev_blue_db("blue_tag")
    cursor = blue_db.cursor()
    start = 1
    end = 99
    while start <= end:
        try:
            rsql = sql % start
            cursor.execute(rsql)
        except Exception, e:
            print " Exception:", e
        start += 1