Initial release

This commit is contained in:
svk 2017-03-12 15:02:21 +03:00
commit df93e6b87d
3 changed files with 116 additions and 0 deletions

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

17
dm.py Normal file
View File

@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
import sys, json, locale
reload(sys)
sys.setdefaultencoding('UTF-8')
sys.setdefaultencoding(locale.getpreferredencoding())
#locale.setlocale(locale.LC_ALL, 'ru_RU.UTF-8')
table_list = open("tables.json", "r")
data = json.load(table_list)
tDescr = data["tables"][0]["tableDescription"]
tName = data["tables"][0]["tableName"]
fList = data["tables"][0]["fList"]
print(tName)
print(tDescr)
print(fList)

93
tables.json Normal file
View File

@ -0,0 +1,93 @@
{
"tables": [
{
"tableName": "users",
"tableDescription": "Список пользователей",
"fList": [
{
"fName": "id",
"fDescr": "Номер п.п.",
"fType": "int(6)",
"index": "PRIMARY KEY",
"autoIncrement": "yes"
},
{
"fName": "username",
"fDescr": "Логин",
"fType": "char(20)",
"index": "yes",
"autoIncrement": "no"
},
{
"fName": "password",
"fDescr": "Пароль",
"fType": "char(20)",
"index": "no",
"autoIncrement": "no"
},
{
"fName": "lastname",
"fDescr": "Фамилия",
"fType": "char(20)",
"index": "no",
"autoIncrement": "no"
},
{
"fName": "name",
"fDescr": "Имя",
"fType": "char(20)",
"index": "no",
"autoIncrement": "no"
},
{
"fName": "middlename",
"fDescr": "Отчество",
"fType": "char(20)",
"index": "no",
"autoIncr": "no"
}
]
},
{
"tableName": "docs",
"tableDescription": "Список документов",
"fList": [
{
"fName": "id",
"fDescr": "Номер п.п.",
"fType": "int(6)",
"index": "PRIMARY KEY",
"autoIncrement": "yes"
},
{
"fName": "docname",
"fDescr": "Наименование",
"fType": "varchar(100)",
"index": "yes",
"autoIncrement": "no"
},
{
"fName": "description",
"fDescr": "Описание",
"fType": "varchar(200)",
"index": "no",
"autoIncrement": "no"
},
{
"fName": "user_id",
"fDescr": "Владелец",
"fType": "int(6)",
"index": "no",
"autoIncrement": "no"
},
{
"fName": "parent_id",
"fDescr": "Имя",
"fType": "int(6)",
"index": "no",
"autoIncrement": "no"
}
]
}
]
}