Edit record procedure fixing has began

This commit is contained in:
svk
2019-04-12 16:36:18 +03:00
parent 8ca81184a9
commit 77da13fbaa
4 changed files with 133 additions and 45 deletions

12
dm.py
View File

@@ -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]: