Day 2, full DB import/update/delete from dir with XML or HTTP

This commit is contained in:
Jack Stdin
2016-01-13 17:38:01 +03:00
parent 3aeb00d82a
commit 67f6943dce
14 changed files with 146 additions and 67 deletions

View File

@@ -2,17 +2,20 @@
class DbSchema:
def __init__(self, name, fieldlist, xmltag):
def __init__(self, name, fieldlist, unique_key, xmltag):
self.tablename = name
self.fields = fieldlist
self.unique_field = unique_key
self.xml_tag = xmltag
db_shemas = dict()
db_shemas['ADDROBJ'] = DbSchema("ADDROBJ",
["AOID", "AOGUID", "SHORTNAME", "FORMALNAME", "AOLEVEL", "PARENTGUID", "ACTSTATUS",
"CURRSTATUS"],
"LIVESTATUS", "NEXTID"],
"aoid",
"Object")
db_shemas['SOCRBASE'] = DbSchema("SOCRBASE", ["LEVEL", "SOCRNAME", "SCNAME", "KOD_T_ST"], "AddressObjectType")
db_shemas['SOCRBASE'] = DbSchema("SOCRBASE", ["LEVEL", "SOCRNAME", "SCNAME", "KOD_T_ST"], "kod_t_st",
"AddressObjectType")
allowed_tables = ["ADDROBJ", "SOCRBASE"]