Code cleaning, and added some function for add record dialog.

This commit is contained in:
Sergey Kalinin
2017-03-20 16:05:59 +03:00
parent 07bb927271
commit 1e8a4a38ac
2 changed files with 26 additions and 22 deletions

4
dm.py
View File

@@ -135,7 +135,7 @@ def createTables(tbl_list):
tbl_descr_list.append(one_Table_descr)
tbl_struct_list.append(one_Table_struct)
print(qwery_create)
c.execute(qwery_create)
#c.execute(qwery_create)
return tbl_names_list
def initDBstructure():
@@ -176,7 +176,7 @@ def selectData(tbl):
field_replace = field_replace.replace(",", ",' ',")
subqwery = "(SELECT CONCAT(" + field_replace + ") FROM " + subqwery + " WHERE " + table1 + "." + field1 + "=" + tbl + "." + field + ") AS " + field
elif db_type == "sqlite":
field_replace = field_replace.replace(",", " || ")
field_replace = field_replace.replace(",", " || ' ' ||")
subqwery = "(SELECT (" + field_replace + ") FROM " + subqwery +" WHERE "+ table1 + "." + field1 +"="+ tbl +"."+ field +") AS " + field
qwery = qwery.replace(field, subqwery)
qwery = qwery.rstrip(',') + " FROM " + tbl + " LIMIT 10000"