-
Notifications
You must be signed in to change notification settings - Fork 83
/
script_shenhe.py
128 lines (104 loc) · 2.91 KB
/
script_shenhe.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
from torcms.model.process_model import MState, MTransition, MTransitionAction, MAction, \
MRequest, MRequestAction,MProcess,MPermissionAction
from torcms.model.process_model import *
def test():
# process = MProcess.query_all().dicts()
# print("*" * 50)
# print("process")
# [print(x) for x in process]
# print("process")
# print("-" * 50)
states = MState.query_all().dicts()
print("*" * 50)
print("Tabstate")
[print(x) for x in states]
print("Tabstate")
print("-" * 50)
action = MAction.query_all().dicts()
print("*" * 50)
print("action")
[print(x) for x in action]
print("action")
print("-" * 50)
# stateaction = MStateAction.query_all().dicts()
# print("*" * 50)
# print("stateaction")
# [print(x) for x in stateaction]
# print("stateaction")
# print("-" * 50)
trans = MTransition.query_all().dicts()
print("*" * 50)
print("Tabtrans")
[print(x) for x in trans]
print("Tabtrans")
print("-" * 50)
transaction = MTransitionAction.query_all().dicts()
print("*" * 50)
print("TransitionAction")
[print(x) for x in transaction]
print("TransitionAction")
print("-" * 50)
request = MRequest.query_all().dicts()
print("*" * 50)
print("request")
[print(x) for x in request]
print("request")
print("-" * 50)
RequestAction = MRequestAction.query_all().dicts()
print("*" * 50)
print("RequestAction")
[print(x) for x in RequestAction]
print("RequestAction")
print("-" * 50)
process = MProcess.query_all().dicts()
print("*" * 50)
print("process")
[print(x) for x in process]
print("process")
print("-" * 50)
permissionaction = MPermissionAction.query_all().dicts()
print("*" * 50)
print("permissionaction")
[print(x) for x in permissionaction]
print("permissionaction")
print("-" * 50)
def drop_the_table(table_name):
'''
Drop a table.
'''
try:
table_name.drop_table()
except Exception as err:
print(repr(err))
def run_drop_tables():
'''
Running the script.
'''
print('--')
drop_the_table(TabRequestAction)
drop_the_table(TabTransitionAction)
drop_the_table(TabTransition)
drop_the_table(TabRequest)
drop_the_table(TabState)
drop_the_table(TabPermissionAction)
drop_the_table(TabAction)
drop_the_table(TabProcess)
if __name__ == '__main__':
test()
# run_drop_tables()
# uu = MState()
# tt = MProcess()
# tt.create_or_update('1', 'Post')
#
# state_arr = [
# ['started', '开始'],
# ['denied', '回退'],
# ['complated', '完成'],
# ['cancceled', '取消'],
# ]
#
# for statinfo in state_arr:
# info = {'state_type': statinfo[0], 'name': statinfo[1]}
# uu.create_or_update(info)
# all_state = uu.query_all().dicts()
# [print(x) for x in all_state]