q2rad 0.1.216__py3-none-any.whl → 0.1.218__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of q2rad might be problematic. Click here for more details.
- q2rad/q2forms.py +3 -2
- q2rad/q2rad.py +40 -11
- q2rad/q2raddb.py +5 -0
- q2rad/version.py +1 -1
- {q2rad-0.1.216.dist-info → q2rad-0.1.218.dist-info}/METADATA +1 -1
- {q2rad-0.1.216.dist-info → q2rad-0.1.218.dist-info}/RECORD +9 -9
- {q2rad-0.1.216.dist-info → q2rad-0.1.218.dist-info}/LICENSE +0 -0
- {q2rad-0.1.216.dist-info → q2rad-0.1.218.dist-info}/WHEEL +0 -0
- {q2rad-0.1.216.dist-info → q2rad-0.1.218.dist-info}/entry_points.txt +0 -0
q2rad/q2forms.py
CHANGED
|
@@ -17,7 +17,7 @@ from q2db.cursor import Q2Cursor
|
|
|
17
17
|
|
|
18
18
|
from q2gui.q2model import Q2CursorModel
|
|
19
19
|
|
|
20
|
-
from q2gui.q2dialogs import q2mess
|
|
20
|
+
from q2gui.q2dialogs import q2mess, q2ask
|
|
21
21
|
from q2gui import q2app
|
|
22
22
|
|
|
23
23
|
from q2rad.q2lines import Q2Lines
|
|
@@ -288,6 +288,7 @@ class Q2Forms(Q2Form, Q2_save_and_run):
|
|
|
288
288
|
super().after_crud_save()
|
|
289
289
|
if self.crud_mode != "EDIT":
|
|
290
290
|
if self.s.form_table:
|
|
291
|
+
ai = "*" if q2ask("Set AUTOINCREMENT for primary key?") else ""
|
|
291
292
|
self.db.insert(
|
|
292
293
|
"lines",
|
|
293
294
|
{
|
|
@@ -298,7 +299,7 @@ class Q2Forms(Q2Form, Q2_save_and_run):
|
|
|
298
299
|
"datatype": "int",
|
|
299
300
|
"migrate": "*",
|
|
300
301
|
"pk": "*",
|
|
301
|
-
"ai":
|
|
302
|
+
"ai": ai,
|
|
302
303
|
},
|
|
303
304
|
)
|
|
304
305
|
self.db.insert(
|
q2rad/q2rad.py
CHANGED
|
@@ -111,7 +111,11 @@ def run_form(form_name, order="", where=""):
|
|
|
111
111
|
return q2app.q2_app.run_form(form_name, order=order, where=where)
|
|
112
112
|
|
|
113
113
|
|
|
114
|
-
def
|
|
114
|
+
def get_form(form_name, order="", where=""):
|
|
115
|
+
return q2app.q2_app.get_form(form_name, order=order, where=where)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def run_module(module_name=None, _globals={}, _locals={}, script="", import_only=False):
|
|
115
119
|
ext_modules = []
|
|
116
120
|
if module_name is not None:
|
|
117
121
|
script = q2app.q2_app.db_logic.get("modules", f"name = '{module_name}'", "script")
|
|
@@ -135,7 +139,7 @@ def run_module(module_name=None, _globals={}, _locals=locals(), script="", impor
|
|
|
135
139
|
else:
|
|
136
140
|
__name__ = "__main__"
|
|
137
141
|
|
|
138
|
-
|
|
142
|
+
_globals.update(
|
|
139
143
|
{
|
|
140
144
|
"RETURN": None,
|
|
141
145
|
"ReturnEvent": ReturnEvent,
|
|
@@ -146,10 +150,14 @@ def run_module(module_name=None, _globals={}, _locals=locals(), script="", impor
|
|
|
146
150
|
}
|
|
147
151
|
)
|
|
148
152
|
_globals.update(globals())
|
|
149
|
-
_globals.update(_locals)
|
|
150
153
|
try:
|
|
151
|
-
|
|
154
|
+
if _locals:
|
|
155
|
+
exec(code["code"], _globals, _locals)
|
|
156
|
+
else:
|
|
157
|
+
exec(code["code"], _globals)
|
|
152
158
|
except ReturnEvent as error:
|
|
159
|
+
if _locals:
|
|
160
|
+
_globals["RETURN"] = _locals["RETURN"]
|
|
153
161
|
pass
|
|
154
162
|
except Exception as error:
|
|
155
163
|
explain_error()
|
|
@@ -161,8 +169,10 @@ def run_module(module_name=None, _globals={}, _locals=locals(), script="", impor
|
|
|
161
169
|
|
|
162
170
|
if res is not None:
|
|
163
171
|
return res
|
|
164
|
-
|
|
165
|
-
|
|
172
|
+
res = _globals.get("RETURN")
|
|
173
|
+
if "RETURN" in _globals:
|
|
174
|
+
del _globals["RETURN"]
|
|
175
|
+
return res
|
|
166
176
|
|
|
167
177
|
|
|
168
178
|
def explain_error(tb=None, errtype=None):
|
|
@@ -762,7 +772,7 @@ class Q2RadApp(Q2App):
|
|
|
762
772
|
upgraded = []
|
|
763
773
|
w = Q2WaitShow(len(packages_list))
|
|
764
774
|
for package in packages_list:
|
|
765
|
-
if w.step(f"{package if isinstance(package, str) else package[0]}"):
|
|
775
|
+
if w.step(f"{package if isinstance(package, str) else package[0]}"):
|
|
766
776
|
break
|
|
767
777
|
latest_version, current_version = self.get_package_versions(package)
|
|
768
778
|
# q2mess([package, latest_version, current_version])
|
|
@@ -1097,7 +1107,8 @@ class Q2RadApp(Q2App):
|
|
|
1097
1107
|
make_binary(self)
|
|
1098
1108
|
|
|
1099
1109
|
def run_form(self, name, order="", where=""):
|
|
1100
|
-
form = q2working(lambda: self.get_form(name, where=where, order=order), "Loading form...")
|
|
1110
|
+
# form = q2working(lambda: self.get_form(name, where=where, order=order), "Loading form...")
|
|
1111
|
+
form = self.get_form(name, where=where, order=order)
|
|
1101
1112
|
form.run()
|
|
1102
1113
|
|
|
1103
1114
|
def get_form(
|
|
@@ -1149,7 +1160,8 @@ class Q2RadApp(Q2App):
|
|
|
1149
1160
|
"""
|
|
1150
1161
|
cu: Q2Cursor = q2cursor(sql, self.db_logic)
|
|
1151
1162
|
|
|
1152
|
-
form = Q2Form(form_dic["title"])
|
|
1163
|
+
mem = form = Q2Form(form_dic["title"])
|
|
1164
|
+
form._name = name
|
|
1153
1165
|
form.no_view_action = False if form_dic["view_action"] else True
|
|
1154
1166
|
form.ok_button = form_dic["ok_button"]
|
|
1155
1167
|
form.cancel_button = form_dic["cancel_button"]
|
|
@@ -1181,6 +1193,7 @@ class Q2RadApp(Q2App):
|
|
|
1181
1193
|
x["show"] = self.code_runner(x["_show"], form)
|
|
1182
1194
|
x["when"] = self.code_runner(x["_when"], form)
|
|
1183
1195
|
form.add_control(**x)
|
|
1196
|
+
run_module("_e_control", _locals=locals())
|
|
1184
1197
|
|
|
1185
1198
|
# add datasource
|
|
1186
1199
|
if form_dic["form_table"]:
|
|
@@ -1192,7 +1205,23 @@ class Q2RadApp(Q2App):
|
|
|
1192
1205
|
form_model = Q2CursorModel(form_cursor)
|
|
1193
1206
|
form.set_model(form_model)
|
|
1194
1207
|
# add actions
|
|
1195
|
-
|
|
1208
|
+
|
|
1209
|
+
ext_actions = []
|
|
1210
|
+
for row in q2cursor("select prefix from extensions order by seq").records():
|
|
1211
|
+
ext_name = row["prefix"]
|
|
1212
|
+
if (
|
|
1213
|
+
get("actions", f"name='{ext_name}{name}'", "name", q2app.q2_app.db_logic)
|
|
1214
|
+
== f"{ext_name}{name}"
|
|
1215
|
+
):
|
|
1216
|
+
ext_actions.append(
|
|
1217
|
+
f"""select * from (select * from actions
|
|
1218
|
+
where name = '{ext_name}{name}' order by seq) qq"""
|
|
1219
|
+
)
|
|
1220
|
+
if ext_actions:
|
|
1221
|
+
ext_select = " union all " + " union all ".join(ext_actions)
|
|
1222
|
+
else:
|
|
1223
|
+
ext_select = ""
|
|
1224
|
+
sql = f"select * from (select * from actions where name = '{name}' order by seq ) qq {ext_select}"
|
|
1196
1225
|
cu = q2cursor(sql, self.db_logic)
|
|
1197
1226
|
for x in cu.records():
|
|
1198
1227
|
if x["action_mode"] == "1":
|
|
@@ -1234,7 +1263,7 @@ class Q2RadApp(Q2App):
|
|
|
1234
1263
|
child_copy_mode=x["child_copy_mode"],
|
|
1235
1264
|
eof_disabled=x["eof_disabled"],
|
|
1236
1265
|
)
|
|
1237
|
-
|
|
1266
|
+
run_module("_e_action", _locals=locals())
|
|
1238
1267
|
return form
|
|
1239
1268
|
|
|
1240
1269
|
def code_compiler(self, script):
|
q2rad/q2raddb.py
CHANGED
q2rad/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.218"
|
|
@@ -5,21 +5,21 @@ q2rad/q2appmanager.py,sha256=o5j4bBz5wTVYn8Dot10HS_O1uyDEyzydOpz0NCxUHKI,19522
|
|
|
5
5
|
q2rad/q2appselector.py,sha256=wS945hPfugCcxoEuRWm8nP1849Slw90CrRYgMhBB4nI,18811
|
|
6
6
|
q2rad/q2constants.py,sha256=dQtN4OMvZw0FATDAFYjolI7eGMVUnNnbTl6qM-ggZ4I,3416
|
|
7
7
|
q2rad/q2extensions.py,sha256=PclrX3vPgqwjQIOqiKrRiJaBvhWlCjDUmmxvnF0FLwc,5281
|
|
8
|
-
q2rad/q2forms.py,sha256=
|
|
8
|
+
q2rad/q2forms.py,sha256=36NriEUquuF97fkHpBBQyw1PDIrBQQlwxb21YVrmtng,11117
|
|
9
9
|
q2rad/q2lines.py,sha256=KQslxn06vypKSFahCDAa7oFPoo_BhvABTKy5iDEOFbc,19133
|
|
10
10
|
q2rad/q2make.py,sha256=wXoyBUwf2zaAl9JjWDCbjAteUElRq0O7ippyaMY9eug,6476
|
|
11
11
|
q2rad/q2market.py,sha256=RNXTNv-fFUgbzBGhHPNXlzGjsAHAtz71BRbTErJarNo,2641
|
|
12
12
|
q2rad/q2modules.py,sha256=FetB84IxsuDzNYKTFM3BdvfH5GrWrFKoi6cV5uW1fKo,4360
|
|
13
13
|
q2rad/q2packages.py,sha256=y72L1RAw1OgtKGaL8lJ1KHIaers5I6kTZSiphwwrY0M,3808
|
|
14
14
|
q2rad/q2queries.py,sha256=RaNQMZaJy97Hcj_iNzSgHkCbM2s-J-vNaW7IyBFFbCc,12602
|
|
15
|
-
q2rad/q2rad.py,sha256
|
|
16
|
-
q2rad/q2raddb.py,sha256=
|
|
15
|
+
q2rad/q2rad.py,sha256=--C8iBgUlOxDHCVjsf6E1rbDIW3oRZ_cIufksiaeV8U,51838
|
|
16
|
+
q2rad/q2raddb.py,sha256=tMX971d_awTwiWeYLkZGSfdrIs88oiNHBAs2cMFvSbU,4685
|
|
17
17
|
q2rad/q2reports.py,sha256=zVQbBoXHcdSPhoGlayzdoZ0b1qrRbafM6r1wP2VP0B4,84480
|
|
18
18
|
q2rad/q2stylesettings.py,sha256=rEJLyLzsffJEXnMbg9bPB3KHLjYfw-49QgrtcYOfGV0,4769
|
|
19
19
|
q2rad/q2utils.py,sha256=Vb5K8Lbb7PzQGDiBEHFrPyDcytVnUSVXy9yIkvWM1Oc,19734
|
|
20
|
-
q2rad/version.py,sha256=
|
|
21
|
-
q2rad-0.1.
|
|
22
|
-
q2rad-0.1.
|
|
23
|
-
q2rad-0.1.
|
|
24
|
-
q2rad-0.1.
|
|
25
|
-
q2rad-0.1.
|
|
20
|
+
q2rad/version.py,sha256=R3Los8W3dDwoWrX7u43DGpUrakSvpbRzdHF-uwHxiU4,23
|
|
21
|
+
q2rad-0.1.218.dist-info/entry_points.txt,sha256=DmsJQE6f3wYuhdN2h6ARYxSe8_d03paeepfGpdVj5rs,42
|
|
22
|
+
q2rad-0.1.218.dist-info/LICENSE,sha256=JRR3LlR18ghhYXT4G2cWgXmnxRvcuVcKlqncWWK4MRY,10347
|
|
23
|
+
q2rad-0.1.218.dist-info/METADATA,sha256=NqA59-fGUhhS9__-Ids4NKCXKDY9XN3xHkrug8kCDdc,3369
|
|
24
|
+
q2rad-0.1.218.dist-info/WHEEL,sha256=WGfLGfLX43Ei_YORXSnT54hxFygu34kMpcQdmgmEwCQ,88
|
|
25
|
+
q2rad-0.1.218.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|