Edit record procedure fixing has began
This commit is contained in:
12
dm.py
12
dm.py
@@ -3,8 +3,8 @@ import json, os, configparser, shutil, re
|
||||
from datetime import datetime, date, time
|
||||
|
||||
def firstInit():
|
||||
# Инициализация переменныхб создание конфигруационного файла, копирование шаблонов
|
||||
global db_type, db_hostname, db_user, db_password, db_name, template_file, db_type
|
||||
# Инициализация переменных создание конфигруационного файла, копирование шаблонов
|
||||
global db_type, db_hostname, db_user, db_password, db_name, template_file, db_type, template_dir
|
||||
config = configparser.RawConfigParser()
|
||||
# проверяем тип ОС
|
||||
if os.name == "nt":
|
||||
@@ -39,6 +39,7 @@ def firstInit():
|
||||
config.read(cfg_file)
|
||||
|
||||
work_dir = config.get('Directory', 'work_dir')
|
||||
global template_dir
|
||||
template_dir = config.get('Directory', 'template_dir')
|
||||
db_type = config.get('DataBase', 'db_type')
|
||||
db_hostname = config.get('DataBase', 'db_hostname')
|
||||
@@ -177,9 +178,9 @@ def initDBstructure():
|
||||
global dbTablesDescriptionList, template_file, tblNamesList
|
||||
table_list = open(template_file, "r", encoding="utf-8")
|
||||
data = json.load(table_list, encoding="utf-8")
|
||||
tbl_list = data["tables"]
|
||||
tblNamesList = createTables(tbl_list)
|
||||
|
||||
#tbl_list = data["tables"]
|
||||
#tblNamesList = createTables(tbl_list)
|
||||
tblNamesList = createTables(data["tables"])
|
||||
return tblNamesList
|
||||
|
||||
# выборка данных из заданной таблицы
|
||||
@@ -188,6 +189,7 @@ def selectData(tbl):
|
||||
# если юольше 1 поля добавить CONCAT
|
||||
qwery = "SELECT "
|
||||
subqwery = ""
|
||||
#print(dbTablesStructList)
|
||||
for item in dbTablesStructList:
|
||||
if item[0] == tbl:
|
||||
for field in item[1]:
|
||||
|
Reference in New Issue
Block a user