q2rad 0.1.200__tar.gz → 0.1.202__tar.gz
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-0.1.200 → q2rad-0.1.202}/PKG-INFO +1 -1
- {q2rad-0.1.200 → q2rad-0.1.202}/pyproject.toml +1 -1
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2actions.py +22 -14
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2appmanager.py +31 -14
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2lines.py +42 -30
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2queries.py +2 -2
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2rad.py +4 -4
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2stylesettings.py +2 -2
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2utils.py +7 -4
- q2rad-0.1.202/q2rad/version.py +1 -0
- q2rad-0.1.200/q2rad/version.py +0 -1
- {q2rad-0.1.200 → q2rad-0.1.202}/LICENSE +0 -0
- {q2rad-0.1.200 → q2rad-0.1.202}/README.md +0 -0
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/__init__.py +0 -0
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/__main__.py +0 -0
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2appselector.py +0 -0
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2constants.py +0 -0
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2forms.py +0 -0
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2make.py +0 -0
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2market.py +0 -0
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2modules.py +0 -0
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2packages.py +0 -0
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2raddb.py +0 -0
- {q2rad-0.1.200 → q2rad-0.1.202}/q2rad/q2reports.py +0 -0
|
@@ -18,6 +18,7 @@ from q2gui.q2model import Q2CursorModel
|
|
|
18
18
|
from q2rad.q2raddb import last_error, insert
|
|
19
19
|
from q2rad.q2utils import q2cursor, choice_form, choice_column, Q2_save_and_run, Q2Form, int_
|
|
20
20
|
from q2gui import q2app
|
|
21
|
+
|
|
21
22
|
# from q2rad import Q2Form
|
|
22
23
|
|
|
23
24
|
import gettext
|
|
@@ -44,17 +45,9 @@ class Q2Actions(Q2Form, Q2_save_and_run):
|
|
|
44
45
|
self.add_action("Copy to", icon="❖", worker=self.copy_to)
|
|
45
46
|
|
|
46
47
|
def create_form(self):
|
|
48
|
+
from q2rad.q2forms import Q2Forms
|
|
49
|
+
|
|
47
50
|
self.add_control("id", "", datatype="int", pk="*", ai="*", noform=1, nogrid=1)
|
|
48
|
-
self.add_control(
|
|
49
|
-
"name",
|
|
50
|
-
_("Form"),
|
|
51
|
-
disabled="*",
|
|
52
|
-
to_table="forms",
|
|
53
|
-
to_column="name",
|
|
54
|
-
related="name",
|
|
55
|
-
datatype="char",
|
|
56
|
-
datalen=100,
|
|
57
|
-
)
|
|
58
51
|
self.add_control("action_text", _("Action text"), datatype="char", datalen=100)
|
|
59
52
|
self.add_control("/")
|
|
60
53
|
if self.add_control("/t", _("Main"), tag="tab"):
|
|
@@ -119,8 +112,22 @@ class Q2Actions(Q2Form, Q2_save_and_run):
|
|
|
119
112
|
control="radio",
|
|
120
113
|
datatype="int",
|
|
121
114
|
)
|
|
115
|
+
self.add_control("/")
|
|
116
|
+
self.add_control("/f")
|
|
117
|
+
self.add_control(
|
|
118
|
+
"name",
|
|
119
|
+
_("Form"),
|
|
120
|
+
# disabled="*",
|
|
121
|
+
to_table="forms",
|
|
122
|
+
to_column="name",
|
|
123
|
+
to_form=Q2Forms(),
|
|
124
|
+
related="name",
|
|
125
|
+
datatype="char",
|
|
126
|
+
datalen=100,
|
|
127
|
+
)
|
|
122
128
|
|
|
123
129
|
self.add_control("/s")
|
|
130
|
+
|
|
124
131
|
self.add_control("/t", _("Action Script"))
|
|
125
132
|
self.add_control(
|
|
126
133
|
"action_worker",
|
|
@@ -151,7 +158,8 @@ class Q2Actions(Q2Form, Q2_save_and_run):
|
|
|
151
158
|
seq = (
|
|
152
159
|
int_(
|
|
153
160
|
q2cursor(
|
|
154
|
-
f"select max(seq) as maxseq from actions where name='{choice['name']}'",
|
|
161
|
+
f"select max(seq) as maxseq from actions where name='{choice['name']}'",
|
|
162
|
+
q2app.q2_app.db_logic,
|
|
155
163
|
).r.maxseq
|
|
156
164
|
)
|
|
157
165
|
+ 1
|
|
@@ -159,7 +167,7 @@ class Q2Actions(Q2Form, Q2_save_and_run):
|
|
|
159
167
|
for x in rows:
|
|
160
168
|
rec = self.model.get_record(x)
|
|
161
169
|
rec["seq"] = seq
|
|
162
|
-
rec["name"] = choice[
|
|
170
|
+
rec["name"] = choice["name"]
|
|
163
171
|
seq += 1
|
|
164
172
|
if not insert("actions", rec, q2app.q2_app.db_logic):
|
|
165
173
|
print(last_error(q2app.q2_app.db_logic))
|
|
@@ -184,7 +192,7 @@ class Q2Actions(Q2Form, Q2_save_and_run):
|
|
|
184
192
|
def select_child_form(self):
|
|
185
193
|
choice = choice_form()
|
|
186
194
|
if choice:
|
|
187
|
-
self.s.child_form = choice[
|
|
195
|
+
self.s.child_form = choice["name"]
|
|
188
196
|
if self.s.child_where == "":
|
|
189
197
|
parent_pk = q2cursor(
|
|
190
198
|
f"""select column
|
|
@@ -199,7 +207,7 @@ class Q2Actions(Q2Form, Q2_save_and_run):
|
|
|
199
207
|
if self.s.child_where.startswith("=") or self.s.child_where == "":
|
|
200
208
|
choice = choice_column(self.s.child_form)
|
|
201
209
|
if choice:
|
|
202
|
-
self.s.child_where = choice[
|
|
210
|
+
self.s.child_where = choice["col"] + self.s.child_where
|
|
203
211
|
|
|
204
212
|
def before_form_show(self):
|
|
205
213
|
self.action_mode_valid()
|
|
@@ -26,6 +26,16 @@ from datetime import datetime
|
|
|
26
26
|
import json
|
|
27
27
|
import os
|
|
28
28
|
|
|
29
|
+
app_tables = [
|
|
30
|
+
"forms",
|
|
31
|
+
"lines",
|
|
32
|
+
"actions",
|
|
33
|
+
"reports",
|
|
34
|
+
"modules",
|
|
35
|
+
"queries",
|
|
36
|
+
"packages",
|
|
37
|
+
]
|
|
38
|
+
|
|
29
39
|
|
|
30
40
|
class AppManager(Q2Form):
|
|
31
41
|
def __init__(self, title=""):
|
|
@@ -40,7 +50,6 @@ class AppManager(Q2Form):
|
|
|
40
50
|
"upgrade",
|
|
41
51
|
"Check updates",
|
|
42
52
|
control="button",
|
|
43
|
-
datalen=10,
|
|
44
53
|
valid=q2app.q2_app.update_packages,
|
|
45
54
|
)
|
|
46
55
|
|
|
@@ -66,7 +75,6 @@ class AppManager(Q2Form):
|
|
|
66
75
|
"reload_assets",
|
|
67
76
|
"Reload assets",
|
|
68
77
|
control="button",
|
|
69
|
-
datalen=10,
|
|
70
78
|
valid=self.reload_assets,
|
|
71
79
|
)
|
|
72
80
|
|
|
@@ -307,7 +315,7 @@ class AppManager(Q2Form):
|
|
|
307
315
|
file = self.validate_impexp_file_name(file, filetype)
|
|
308
316
|
if file:
|
|
309
317
|
if app_json is None:
|
|
310
|
-
app_json = self.get_app_json
|
|
318
|
+
app_json = q2working(self.get_app_json, "Prepare data...")
|
|
311
319
|
if app_json:
|
|
312
320
|
json.dump(app_json, open(file, "w"), indent=1)
|
|
313
321
|
|
|
@@ -315,6 +323,8 @@ class AppManager(Q2Form):
|
|
|
315
323
|
db: Q2Db = q2app.q2_app.db_logic
|
|
316
324
|
rez = {}
|
|
317
325
|
for x in db.get_tables():
|
|
326
|
+
if x not in app_tables:
|
|
327
|
+
continue
|
|
318
328
|
if x.startswith("log_") or x == "sqlite_sequence":
|
|
319
329
|
continue
|
|
320
330
|
rez[x] = []
|
|
@@ -332,18 +342,23 @@ class AppManager(Q2Form):
|
|
|
332
342
|
|
|
333
343
|
file = self.validate_impexp_file_name(file, filetype)
|
|
334
344
|
if file:
|
|
335
|
-
|
|
336
|
-
rez = {}
|
|
337
|
-
for x in db.get_tables():
|
|
338
|
-
if x.startswith("log_") or x == "sqlite_sequence":
|
|
339
|
-
continue
|
|
340
|
-
rez[x] = []
|
|
341
|
-
for row in db.table(x).records():
|
|
342
|
-
rez[x].append(row)
|
|
343
|
-
|
|
345
|
+
rez = q2working(self.get_data_json, "Prepare data...")
|
|
344
346
|
if rez:
|
|
345
347
|
json.dump(rez, open(file, "w"), indent=1)
|
|
346
348
|
|
|
349
|
+
def get_data_json(self):
|
|
350
|
+
db: Q2Db = q2app.q2_app.db_data
|
|
351
|
+
rez = {}
|
|
352
|
+
for x in db.get_tables():
|
|
353
|
+
if x in app_tables:
|
|
354
|
+
continue
|
|
355
|
+
if x.startswith("log_") or x == "sqlite_sequence":
|
|
356
|
+
continue
|
|
357
|
+
rez[x] = []
|
|
358
|
+
for row in db.table(x).records():
|
|
359
|
+
rez[x].append(row)
|
|
360
|
+
return rez
|
|
361
|
+
|
|
347
362
|
def import_q2market(self):
|
|
348
363
|
self.q2_app.check_app_update(force_update=True)
|
|
349
364
|
|
|
@@ -373,9 +388,9 @@ class AppManager(Q2Form):
|
|
|
373
388
|
continue
|
|
374
389
|
wait_row = Q2WaitShow(len(data[table]))
|
|
375
390
|
if table != "packages":
|
|
376
|
-
db.cursor(f'delete from `{table}` where name not like "
|
|
391
|
+
db.cursor(f'delete from `{table}` where name not like "\\_%"')
|
|
377
392
|
if db.last_sql_error:
|
|
378
|
-
|
|
393
|
+
errors.append(db.last_sql_error)
|
|
379
394
|
for row in data[table]:
|
|
380
395
|
wait_row.step()
|
|
381
396
|
if table == "packages":
|
|
@@ -384,6 +399,8 @@ class AppManager(Q2Form):
|
|
|
384
399
|
== row["package_name"]
|
|
385
400
|
):
|
|
386
401
|
continue
|
|
402
|
+
if row.get("name", "").startswith("_"):
|
|
403
|
+
continue
|
|
387
404
|
if not db.insert(table, row):
|
|
388
405
|
errors.append(db.last_sql_error)
|
|
389
406
|
errors.append(db.last_record)
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
from q2gui.q2model import Q2CursorModel
|
|
17
17
|
from q2rad.q2raddb import Q2Cursor, insert
|
|
18
|
-
from q2gui.q2dialogs import q2AskYN
|
|
18
|
+
from q2gui.q2dialogs import q2AskYN, q2mess
|
|
19
19
|
from q2rad.q2utils import q2cursor, choice_table, choice_column, choice_form, Q2_save_and_run
|
|
20
20
|
from q2rad.q2raddb import last_error
|
|
21
21
|
|
|
@@ -99,19 +99,11 @@ class Q2Lines(Q2Form, Q2_save_and_run):
|
|
|
99
99
|
self.add_action("Layout|Form", icon="☆", worker=lambda: self.add_layout("/f"))
|
|
100
100
|
self.add_action("Layout|Horizontally", worker=lambda: self.add_layout("/h"))
|
|
101
101
|
self.add_action("Layout|Vertically", worker=lambda: self.add_layout("/v"))
|
|
102
|
+
self.add_action("Alter column", icon="🔧", worker=self.alter_column)
|
|
102
103
|
|
|
103
104
|
def create_form(self):
|
|
105
|
+
from q2rad.q2forms import Q2Forms
|
|
104
106
|
self.add_control("id", "", datatype="int", pk="*", ai="*", noform=1, nogrid=1)
|
|
105
|
-
self.add_control(
|
|
106
|
-
"name",
|
|
107
|
-
_("Form"),
|
|
108
|
-
# disabled="*",
|
|
109
|
-
to_table="forms",
|
|
110
|
-
to_column="name",
|
|
111
|
-
related="name",
|
|
112
|
-
datatype="char",
|
|
113
|
-
datalen=100,
|
|
114
|
-
)
|
|
115
107
|
self.add_control("column", _("Column name"), datalen=50)
|
|
116
108
|
self.add_control("/")
|
|
117
109
|
if self.add_control("/t", _("Main")):
|
|
@@ -130,7 +122,7 @@ class Q2Lines(Q2Form, Q2_save_and_run):
|
|
|
130
122
|
self.add_control("/")
|
|
131
123
|
if self.add_control("/h"):
|
|
132
124
|
self.add_control("stretch", _("Stretch factor"), datatype="int")
|
|
133
|
-
self.add_control("alignment", _("Alignment"), datatype="int",datalen=3)
|
|
125
|
+
self.add_control("alignment", _("Alignment"), datatype="int", datalen=3)
|
|
134
126
|
self.add_control("tag", _("Tag"), datatype="char", datalen=100)
|
|
135
127
|
self.add_control("/")
|
|
136
128
|
if self.add_control("/h", _("Control type")):
|
|
@@ -196,7 +188,6 @@ class Q2Lines(Q2Form, Q2_save_and_run):
|
|
|
196
188
|
_("?"),
|
|
197
189
|
mess=_("Open list of existing tables"),
|
|
198
190
|
control="button",
|
|
199
|
-
datalen=3,
|
|
200
191
|
valid=self.select_linked_table,
|
|
201
192
|
)
|
|
202
193
|
self.add_control("to_table", gridlabel=_("To table"), datatype="char", datalen=100)
|
|
@@ -207,20 +198,20 @@ class Q2Lines(Q2Form, Q2_save_and_run):
|
|
|
207
198
|
_("?"),
|
|
208
199
|
mess=_("Open list of existing tables"),
|
|
209
200
|
control="button",
|
|
210
|
-
datalen=3,
|
|
211
201
|
valid=self.select_linked_table_pk,
|
|
212
202
|
)
|
|
213
203
|
self.add_control("to_column", gridlabel=_("To field"), datatype="char", datalen=100)
|
|
214
204
|
self.add_control("/")
|
|
215
205
|
if self.add_control("/h", _("Data to show")):
|
|
206
|
+
self.add_control("/v")
|
|
216
207
|
self.add_control(
|
|
217
208
|
"select_column",
|
|
218
209
|
_("?"),
|
|
219
210
|
mess=_("Open list of existing columns"),
|
|
220
211
|
control="button",
|
|
221
|
-
datalen=3,
|
|
222
212
|
valid=self.select_linked_table_column,
|
|
223
213
|
)
|
|
214
|
+
self.add_control("/")
|
|
224
215
|
self.add_control(
|
|
225
216
|
"related", control="codesql", gridlabel=_("Data to show"), datatype="text"
|
|
226
217
|
)
|
|
@@ -231,7 +222,6 @@ class Q2Lines(Q2Form, Q2_save_and_run):
|
|
|
231
222
|
_("?"),
|
|
232
223
|
mess=_("Open list of existing forms"),
|
|
233
224
|
control="button",
|
|
234
|
-
datalen=3,
|
|
235
225
|
valid=self.select_linked_form,
|
|
236
226
|
)
|
|
237
227
|
self.add_control("to_form", gridlabel=_("Form to open"), datatype="char", datalen=100)
|
|
@@ -239,6 +229,20 @@ class Q2Lines(Q2Form, Q2_save_and_run):
|
|
|
239
229
|
|
|
240
230
|
self.add_control("/")
|
|
241
231
|
|
|
232
|
+
self.add_control("/f")
|
|
233
|
+
self.add_control(
|
|
234
|
+
"name",
|
|
235
|
+
_("Form"),
|
|
236
|
+
# disabled="*",
|
|
237
|
+
to_table="forms",
|
|
238
|
+
to_column="name",
|
|
239
|
+
to_form=Q2Forms(),
|
|
240
|
+
related="name",
|
|
241
|
+
datatype="char",
|
|
242
|
+
datalen=100,
|
|
243
|
+
)
|
|
244
|
+
self.add_control("/")
|
|
245
|
+
|
|
242
246
|
self.add_control("/s")
|
|
243
247
|
|
|
244
248
|
self.add_control("/t", _("Comment"))
|
|
@@ -277,6 +281,13 @@ class Q2Lines(Q2Form, Q2_save_and_run):
|
|
|
277
281
|
self.controls.delete("save_and_run_actions_visible")
|
|
278
282
|
self.system_controls.insert(2, self._save_and_run_control)
|
|
279
283
|
|
|
284
|
+
def alter_column(self):
|
|
285
|
+
if self.r.migrate and q2AskYN(f"Alter column {self.r.column}?") == 2:
|
|
286
|
+
record = self.get_current_record()
|
|
287
|
+
record["table"] = self.db.get("forms", f"name = '{self.prev_form.r.name}'", "form_table")
|
|
288
|
+
if not q2app.q2_app.db_data.alter_column(record):
|
|
289
|
+
q2mess(self.db_data.migrate_error_list)
|
|
290
|
+
|
|
280
291
|
def copy_to(self):
|
|
281
292
|
rows = self.get_grid_selected_rows()
|
|
282
293
|
choice = choice_form()
|
|
@@ -374,20 +385,21 @@ class Q2Lines(Q2Form, Q2_save_and_run):
|
|
|
374
385
|
|
|
375
386
|
cols = self.q2_app.db_data.db_schema.get_schema_columns(self.prev_form.r.form_table)
|
|
376
387
|
for x in cols:
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
388
|
+
if self.db.get("lines", f"name = '{self.prev_form.r.name}' and column = '{x}'") == {}:
|
|
389
|
+
insert(
|
|
390
|
+
"lines",
|
|
391
|
+
{
|
|
392
|
+
"name": self.prev_form.r.name,
|
|
393
|
+
"column": x,
|
|
394
|
+
"label": x,
|
|
395
|
+
"datatype": cols[x]["datatype"],
|
|
396
|
+
"datalen": cols[x]["datalen"],
|
|
397
|
+
"pk": cols[x]["pk"],
|
|
398
|
+
"ai": cols[x]["ai"],
|
|
399
|
+
"migrate": "*",
|
|
400
|
+
},
|
|
401
|
+
self.db,
|
|
402
|
+
)
|
|
391
403
|
self.refresh()
|
|
392
404
|
|
|
393
405
|
def before_crud_save(self):
|
|
@@ -171,6 +171,7 @@ class Q2QueryEdit(Q2Form):
|
|
|
171
171
|
self.query_list = Q2QueryList(self)
|
|
172
172
|
self.param_list = Q2ParamList()
|
|
173
173
|
self.actions = Q2Actions()
|
|
174
|
+
self._db = None
|
|
174
175
|
self.actions.add_action("Run F4", self.query_list.sql_runner, hotkey="F4")
|
|
175
176
|
|
|
176
177
|
self.actions.show_main_button = 0
|
|
@@ -257,7 +258,7 @@ class Q2QueryList(Q2Form):
|
|
|
257
258
|
sql = sql.replace(x, f"{value}")
|
|
258
259
|
else:
|
|
259
260
|
sql = sql.replace(x, f"'{value}'")
|
|
260
|
-
q2cursor(sql).browse()
|
|
261
|
+
q2cursor(sql, q2_db=self.query_editor_form._db).browse()
|
|
261
262
|
|
|
262
263
|
def sql_to_model(self, sql):
|
|
263
264
|
self.model.update({"sql": sql}, self.current_row, refresh=False)
|
|
@@ -317,7 +318,6 @@ class Q2ParamList(Q2Form):
|
|
|
317
318
|
return params
|
|
318
319
|
|
|
319
320
|
def get_param(self, param):
|
|
320
|
-
print(self.model.records)
|
|
321
321
|
for x in self.model.records:
|
|
322
322
|
if x["name"] == (param[1:] if param.startswith(":") else param[1:-1]):
|
|
323
323
|
return x["value"]
|
|
@@ -421,7 +421,6 @@ class Q2RadApp(Q2App):
|
|
|
421
421
|
def _open_database(self, database_name, db_engine_name, host, port, password, user, guest_mode=None):
|
|
422
422
|
db = None
|
|
423
423
|
first_pass = 0
|
|
424
|
-
|
|
425
424
|
while True:
|
|
426
425
|
try:
|
|
427
426
|
db = q2working(
|
|
@@ -465,7 +464,8 @@ class Q2RadApp(Q2App):
|
|
|
465
464
|
),
|
|
466
465
|
mess=_("Creating database"),
|
|
467
466
|
)
|
|
468
|
-
except Exception:
|
|
467
|
+
except Exception as error:
|
|
468
|
+
q2mess(f"Error occured while creating the database:<br>{error}")
|
|
469
469
|
return None
|
|
470
470
|
|
|
471
471
|
def open_databases(self):
|
|
@@ -491,7 +491,7 @@ class Q2RadApp(Q2App):
|
|
|
491
491
|
self.last_root_password = ""
|
|
492
492
|
if self.db_data is None or self.db_logic is None:
|
|
493
493
|
self.selected_application = {}
|
|
494
|
-
q2Mess(_("Can not open database"))
|
|
494
|
+
# q2Mess(_("Can not open database"))
|
|
495
495
|
self.open_application()
|
|
496
496
|
|
|
497
497
|
def create_menu(self):
|
|
@@ -799,7 +799,7 @@ class Q2RadApp(Q2App):
|
|
|
799
799
|
f" {_source_suffix}{package}{_source_postfix}"
|
|
800
800
|
)
|
|
801
801
|
if trm.exit_code != 0:
|
|
802
|
-
q2mess(f"Error occured while
|
|
802
|
+
q2mess(f"Error occured while updating <b>{package}</b>! See output for details.")
|
|
803
803
|
w.close()
|
|
804
804
|
q2Mess("Finished!<p>The program will be restarted!")
|
|
805
805
|
self.restart()
|
|
@@ -114,8 +114,8 @@ class AppStyleSettings(Q2Form):
|
|
|
114
114
|
self.q2_app.set_color_mode(color_mode)
|
|
115
115
|
|
|
116
116
|
def font_size_valid(self):
|
|
117
|
-
if int_(self.s.font_size) <
|
|
118
|
-
self.s.font_size =
|
|
117
|
+
if int_(self.s.font_size) < 10:
|
|
118
|
+
self.s.font_size = 10
|
|
119
119
|
if self.s.apply:
|
|
120
120
|
self.q2_app.q2style.font_size = int_(self.s.font_size)
|
|
121
121
|
self.style_valid()
|
|
@@ -217,7 +217,8 @@ class Q2Form(_Q2Form):
|
|
|
217
217
|
f"""select *
|
|
218
218
|
from log_{self.model.get_table_name()}
|
|
219
219
|
where {pk} = '{self.r.__getattr__(pk)}'
|
|
220
|
-
"""
|
|
220
|
+
""",
|
|
221
|
+
q2_db=self.db,
|
|
221
222
|
)
|
|
222
223
|
elif choice == 3:
|
|
223
224
|
where = self.model.get_where()
|
|
@@ -226,7 +227,8 @@ class Q2Form(_Q2Form):
|
|
|
226
227
|
f"""select *
|
|
227
228
|
from log_{self.model.get_table_name()}
|
|
228
229
|
{where}
|
|
229
|
-
"""
|
|
230
|
+
""",
|
|
231
|
+
self.db,
|
|
230
232
|
)
|
|
231
233
|
form = Q2Form(f"Changelog ({self.title})")
|
|
232
234
|
form.add_control("/")
|
|
@@ -263,6 +265,7 @@ class Q2Form(_Q2Form):
|
|
|
263
265
|
from q2rad.q2queries import Q2QueryEdit
|
|
264
266
|
|
|
265
267
|
form.query_edit = Q2QueryEdit()
|
|
268
|
+
form.query_edit._db = self.db
|
|
266
269
|
form.add_control("ql", "", widget=form.query_edit, nogrid=1, migrate=0)
|
|
267
270
|
|
|
268
271
|
def after_form_show():
|
|
@@ -282,10 +285,10 @@ class Q2Form(_Q2Form):
|
|
|
282
285
|
|
|
283
286
|
|
|
284
287
|
class q2cursor(Q2Cursor):
|
|
285
|
-
def __init__(self, sql="", q2_db=None):
|
|
288
|
+
def __init__(self, sql="", q2_db=None, data=[]):
|
|
286
289
|
if q2_db is None:
|
|
287
290
|
q2_db = q2app.q2_app.db_data
|
|
288
|
-
super().__init__(q2_db, sql)
|
|
291
|
+
super().__init__(q2_db, sql, data=data)
|
|
289
292
|
if q2_db.last_sql_error:
|
|
290
293
|
print(q2_db.last_sql_error)
|
|
291
294
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.202"
|
q2rad-0.1.200/q2rad/version.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.200"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|