Exemplo n.º 1
0
def get_static_wholetable(tableName):
#     global arr_tb_staticName
#     global arrPkName
#     global arr_id_list
    index = -1
    table = None
    rtnData = []
    
    for tbName in arr_tb_name_template:
        if tbName == tableName:
            try:
                index = arr_tb_name_template.index(tableName)
            finally:
                break
    
    if index >= 0:
        if not arr_id_list[index]:
            pk_list = get_static_data_pklist(tableName, arr_key_name_template[index])
            arr_id_list[index] = pk_list
#         table = admin_by_tableName(tableName)
        table = arr_tb_static[index]
    
    for dicPK in arr_id_list[index]:
        pkValue = dicPK.get(arr_key_name_template[index])
        if pkValue:
            record = table.getObjData(pkValue)
#             print("pkValue ============= ", pkValue)
            if record:
                rtnData.append(record)
    return rtnData
Exemplo n.º 2
0
def admin_by_tablename(tableName):
    for tb in arr_tb_name_template:
        if tb == tableName:
            index = arr_tb_name_template.index(tb)
            return arr_tb_static[index]