From df93e6b87d9cfd03840852a7e501326803f2bfa3 Mon Sep 17 00:00:00 2001 From: svk Date: Sun, 12 Mar 2017 15:02:21 +0300 Subject: [PATCH] Initial release --- .idea/vcs.xml | 6 ++++ dm.py | 17 ++++++++++ tables.json | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 .idea/vcs.xml create mode 100644 dm.py create mode 100644 tables.json diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/dm.py b/dm.py new file mode 100644 index 0000000..7b3d9c3 --- /dev/null +++ b/dm.py @@ -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) + diff --git a/tables.json b/tables.json new file mode 100644 index 0000000..0d35f3d --- /dev/null +++ b/tables.json @@ -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" + } + ] + } + ] +}