educommon 3.12.0__py3-none-any.whl → 3.13.2__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.
- educommon/__init__.py +0 -1
- educommon/about/ui/actions.py +16 -30
- educommon/about/ui/ui.py +3 -12
- educommon/about/utils.py +6 -5
- educommon/async_task/__init__.py +0 -1
- educommon/async_task/actions.py +18 -13
- educommon/async_task/apps.py +4 -0
- educommon/async_task/locker.py +2 -5
- educommon/async_task/migrations/0001_initial.py +55 -9
- educommon/async_task/migrations/0002_task_type_and_status_data.py +94 -89
- educommon/async_task/migrations/0003_alter_runningtask_options.py +0 -1
- educommon/async_task/models.py +9 -6
- educommon/async_task/tasks.py +11 -7
- educommon/async_task/ui.py +16 -35
- educommon/async_tasks/__init__.py +0 -1
- educommon/async_tasks/apps.py +4 -0
- educommon/async_tasks/locks.py +11 -21
- educommon/async_tasks/migrations/0001_initial.py +68 -8
- educommon/async_tasks/migrations/0002_load_initial_data.py +0 -1
- educommon/async_tasks/models.py +9 -29
- educommon/async_tasks/tasks.py +25 -54
- educommon/audit_log/__init__.py +1 -0
- educommon/audit_log/actions.py +27 -36
- educommon/audit_log/app_meta.py +7 -4
- educommon/audit_log/apps.py +44 -29
- educommon/audit_log/constants.py +7 -4
- educommon/audit_log/error_log/actions.py +1 -3
- educommon/audit_log/helpers.py +2 -4
- educommon/audit_log/management/commands/reinstall_audit_log.py +11 -7
- educommon/audit_log/migrations/0001_initial.py +91 -16
- educommon/audit_log/migrations/0002_install_audit_log.py +13 -13
- educommon/audit_log/migrations/0003_logproxy.py +1 -3
- educommon/audit_log/migrations/0004_reinstall_audit_log.py +1 -4
- educommon/audit_log/migrations/0005_postgresql_error.py +4 -2
- educommon/audit_log/migrations/0006_auto_20200806_1707.py +3 -4
- educommon/audit_log/migrations/0007_create_selective_tables_function.py +8 -5
- educommon/audit_log/migrations/0008_table_logged.py +0 -1
- educommon/audit_log/migrations/0009_reinstall_audit_log.py +0 -1
- educommon/audit_log/models.py +36 -42
- educommon/audit_log/permissions.py +11 -9
- educommon/audit_log/proxies.py +12 -23
- educommon/audit_log/ui.py +18 -15
- educommon/audit_log/utils/__init__.py +28 -60
- educommon/audit_log/utils/operations.py +16 -2
- educommon/auth/__init__.py +0 -3
- educommon/auth/rbac/__init__.py +2 -4
- educommon/auth/rbac/actions.py +148 -145
- educommon/auth/rbac/app_meta.py +9 -6
- educommon/auth/rbac/backends/base.py +2 -8
- educommon/auth/rbac/backends/caching.py +27 -37
- educommon/auth/rbac/backends/simple.py +1 -4
- educommon/auth/rbac/checker.py +1 -3
- educommon/auth/rbac/management/commands/rbac.py +6 -11
- educommon/auth/rbac/manager.py +18 -47
- educommon/auth/rbac/migrations/0001_initial.py +73 -12
- educommon/auth/rbac/migrations/0002_model_modifier_metaclass_fix.py +7 -6
- educommon/auth/rbac/migrations/0003_permission_hidden.py +1 -5
- educommon/auth/rbac/migrations/0004_auto_20171024_1245.py +26 -19
- educommon/auth/rbac/models.py +63 -68
- educommon/auth/rbac/permissions.py +6 -7
- educommon/auth/rbac/ui.py +83 -84
- educommon/auth/rbac/utils.py +10 -11
- educommon/auth/rbac/validators.py +4 -5
- educommon/auth/simple_auth/__init__.py +1 -5
- educommon/auth/simple_auth/actions.py +79 -92
- educommon/auth/simple_auth/app_meta.py +2 -9
- educommon/auth/simple_auth/checkers.py +3 -3
- educommon/auth/simple_auth/migrations/0001_initial.py +23 -4
- educommon/auth/simple_auth/validators.py +0 -1
- educommon/contingent/actions.py +7 -7
- educommon/contingent/app_meta.py +1 -4
- educommon/contingent/base.py +10 -15
- educommon/contingent/catalogs.py +424 -540
- educommon/contingent/contingent_plugin/actions.py +4 -15
- educommon/contingent/contingent_plugin/apps.py +10 -4
- educommon/contingent/contingent_plugin/migrations/0001_initial.py +5 -6
- educommon/contingent/contingent_plugin/migrations/0002_add_contingent_model_deleted.py +6 -11
- educommon/contingent/contingent_plugin/model_views.py +2 -12
- educommon/contingent/contingent_plugin/models.py +2 -7
- educommon/contingent/contingent_plugin/observer.py +14 -13
- educommon/contingent/contingent_plugin/plugin_meta.py +1 -3
- educommon/contingent/contingent_plugin/storage.py +8 -7
- educommon/contingent/contingent_plugin/utils.py +6 -6
- educommon/django/db/fields.py +72 -86
- educommon/django/db/migration/__init__.py +3 -7
- educommon/django/db/migration/operations.py +29 -51
- educommon/django/db/mixins/__init__.py +16 -10
- educommon/django/db/mixins/date_interval.py +47 -75
- educommon/django/db/mixins/validation.py +26 -26
- educommon/django/db/model_view/__init__.py +18 -22
- educommon/django/db/models.py +9 -8
- educommon/django/db/observer.py +9 -27
- educommon/django/db/partitioning/__init__.py +66 -92
- educommon/django/db/partitioning/management/commands/apply_partitioning.py +3 -13
- educommon/django/db/partitioning/management/commands/clear_table.py +18 -14
- educommon/django/db/partitioning/management/commands/split_table.py +18 -13
- educommon/django/db/routers.py +6 -15
- educommon/django/db/signals.py +149 -2
- educommon/django/db/utils.py +14 -19
- educommon/django/db/validators/__init__.py +1 -0
- educommon/django/db/validators/simple.py +72 -100
- educommon/django/storages/atcfs/api.py +39 -53
- educommon/django/storages/atcfs/app_meta.py +1 -1
- educommon/django/storages/atcfs/management/commands/atcfs_migrate.py +42 -55
- educommon/django/storages/atcfs/models.py +0 -3
- educommon/django/storages/atcfs/monkey_patching.py +18 -12
- educommon/django/storages/atcfs/storage.py +14 -23
- educommon/extjs/fields/input_params.py +15 -45
- educommon/importer/XLSReader.py +143 -241
- educommon/importer/__init__.py +86 -4
- educommon/importer/api.py +53 -84
- educommon/importer/constants.py +4 -14
- educommon/importer/loggers.py +16 -26
- educommon/importer/proxy.py +131 -176
- educommon/importer/proxy_import.py +11 -12
- educommon/importer/report.py +4 -6
- educommon/importer/ui.py +32 -26
- educommon/importer/validators.py +4 -7
- educommon/integration_entities/helpers.py +14 -18
- educommon/ioc/__init__.py +3 -6
- educommon/logger/loggers.py +10 -14
- educommon/m3/__init__.py +20 -38
- educommon/m3/extensions/__init__.py +1 -0
- educommon/m3/extensions/listeners/__init__.py +22 -38
- educommon/m3/extensions/listeners/delete_check/listeners.py +31 -41
- educommon/m3/extensions/listeners/delete_check/mixins.py +20 -25
- educommon/m3/extensions/listeners/delete_check/signals.py +2 -2
- educommon/m3/extensions/listeners/delete_check/ui.py +15 -14
- educommon/m3/extensions/listeners/delete_check/utils.py +9 -11
- educommon/m3/extensions/ui.py +15 -33
- educommon/m3/transaction_context.py +17 -19
- educommon/objectpack/actions.py +70 -88
- educommon/objectpack/apps.py +5 -0
- educommon/objectpack/filters.py +9 -15
- educommon/objectpack/ui.py +59 -77
- educommon/report/__init__.py +9 -5
- educommon/report/actions.py +29 -32
- educommon/report/constructor/__init__.py +5 -8
- educommon/report/constructor/app_meta.py +1 -3
- educommon/report/constructor/apps.py +1 -0
- educommon/report/constructor/base.py +33 -80
- educommon/report/constructor/builders/excel/_base.py +138 -286
- educommon/report/constructor/builders/excel/_header.py +2 -9
- educommon/report/constructor/builders/excel/product.py +13 -34
- educommon/report/constructor/builders/excel/with_merged_cells.py +18 -14
- educommon/report/constructor/config.py +2 -0
- educommon/report/constructor/editor/actions.py +101 -215
- educommon/report/constructor/editor/ui.py +71 -93
- educommon/report/constructor/exceptions.py +6 -12
- educommon/report/constructor/migrations/0001_initial.py +36 -44
- educommon/report/constructor/migrations/0002_report_filters.py +86 -72
- educommon/report/constructor/migrations/0003_reportfilter_exclude.py +5 -5
- educommon/report/constructor/migrations/0004_reportfilter_fields.py +22 -18
- educommon/report/constructor/migrations/0005_reportcolumn_visible.py +5 -4
- educommon/report/constructor/migrations/0006_reportsorting.py +21 -17
- educommon/report/constructor/migrations/0007_include_available_units.py +14 -14
- educommon/report/constructor/migrations/0008_auto_20170407_1318.py +4 -5
- educommon/report/constructor/migrations/0009_auto_20180405_0642.py +1 -4
- educommon/report/constructor/migrations/0010_add_aggregate_fields.py +7 -8
- educommon/report/constructor/mixins.py +14 -15
- educommon/report/constructor/models.py +76 -124
- educommon/report/constructor/utils.py +3 -8
- educommon/report/constructor/validators.py +1 -3
- educommon/report/reporter.py +25 -43
- educommon/report/utils.py +14 -40
- educommon/rest/actions.py +7 -11
- educommon/rest/context.py +6 -16
- educommon/rest/controllers.py +10 -10
- educommon/rest/mixins.py +29 -27
- educommon/secure_media/app_meta.py +9 -9
- educommon/utils/__init__.py +3 -2
- educommon/utils/caching.py +1 -3
- educommon/utils/conversion.py +1 -3
- educommon/utils/crypto.py +1 -2
- educommon/utils/date.py +13 -26
- educommon/utils/db/__init__.py +17 -26
- educommon/utils/db/postgresql.py +1 -4
- educommon/utils/fonts/__init__.py +3 -4
- educommon/utils/licence/__init__.py +5 -16
- educommon/utils/misc.py +9 -18
- educommon/utils/object_grid.py +55 -62
- educommon/utils/phone_number/modelfields.py +1 -3
- educommon/utils/phone_number/phone_number.py +5 -8
- educommon/utils/phone_number/validators.py +8 -23
- educommon/utils/plugins.py +15 -28
- educommon/utils/registry.py +2 -1
- educommon/utils/seqtools.py +1 -3
- educommon/utils/serializer.py +9 -16
- educommon/utils/storage.py +3 -2
- educommon/utils/system.py +1 -3
- educommon/utils/system_app/management/commands/delete_objects.py +17 -34
- educommon/utils/ui.py +87 -84
- educommon/utils/xml/__init__.py +2 -7
- educommon/utils/xml/resolver.py +1 -0
- educommon/ws_log/actions.py +31 -76
- educommon/ws_log/base.py +6 -20
- educommon/ws_log/migrations/0001_initial.py +25 -8
- educommon/ws_log/migrations/0002_auto_20160628_1334.py +0 -1
- educommon/ws_log/migrations/0003_add_fields_to_smev_logs.py +20 -4
- educommon/ws_log/migrations/0004_auto_20160727_1600.py +7 -6
- educommon/ws_log/migrations/0005_auto_20161130_1615.py +14 -4
- educommon/ws_log/migrations/0006_auto_20170327_1027.py +3 -2
- educommon/ws_log/migrations/0007_auto_20180607_1040.py +8 -9
- educommon/ws_log/migrations/0008_auto_20180713_1445.py +23 -10
- educommon/ws_log/migrations/0009_auto_20201130_1553.py +7 -2
- educommon/ws_log/models.py +21 -35
- educommon/ws_log/provider.py +2 -1
- educommon/ws_log/report.py +8 -13
- educommon/ws_log/smev/applications.py +12 -27
- educommon/ws_log/smev/exceptions.py +2 -3
- educommon/ws_log/ui.py +32 -32
- educommon/ws_log/utils.py +1 -3
- educommon-3.13.2.dist-info/METADATA +57 -0
- educommon-3.13.2.dist-info/RECORD +354 -0
- {educommon-3.12.0.dist-info → educommon-3.13.2.dist-info}/WHEEL +1 -1
- educommon/utils/patches.py +0 -27
- educommon/version.conf +0 -11
- educommon-3.12.0.dist-info/METADATA +0 -47
- educommon-3.12.0.dist-info/RECORD +0 -357
- educommon-3.12.0.dist-info/dependency_links.txt +0 -1
- {educommon-3.12.0.dist-info → educommon-3.13.2.dist-info}/top_level.txt +0 -0
@@ -79,9 +79,7 @@ class ListWindow(BaseListWindow):
|
|
79
79
|
super(ListWindow, self)._do_layout()
|
80
80
|
|
81
81
|
self.grid.top_bar.items.insert(0, self.grid.top_bar.button__build)
|
82
|
-
self.grid.context_menu_row.items.append(
|
83
|
-
self.grid.context_menu_row.menuitem__build
|
84
|
-
)
|
82
|
+
self.grid.context_menu_row.items.append(self.grid.context_menu_row.menuitem__build)
|
85
83
|
|
86
84
|
def set_params(self, params):
|
87
85
|
super(ListWindow, self).set_params(params)
|
@@ -89,6 +87,8 @@ class ListWindow(BaseListWindow):
|
|
89
87
|
self.template_globals = local_template('list-window.js')
|
90
88
|
|
91
89
|
self.build_action_url = params['build_action_url']
|
90
|
+
|
91
|
+
|
92
92
|
# -----------------------------------------------------------------------------
|
93
93
|
# Вкладка "Столбцы" окна редактирования шаблона.
|
94
94
|
|
@@ -97,7 +97,6 @@ class AvailableColumnsTree(ExtTree):
|
|
97
97
|
"""Дерево доступных для использования в отчете столбцов."""
|
98
98
|
|
99
99
|
class ToolBar(ExtToolBar):
|
100
|
-
|
101
100
|
def __init__(self, *args, **kwargs):
|
102
101
|
super(AvailableColumnsTree.ToolBar, self).__init__(*args, **kwargs)
|
103
102
|
|
@@ -108,9 +107,7 @@ class AvailableColumnsTree(ExtTree):
|
|
108
107
|
disabled=True,
|
109
108
|
)
|
110
109
|
|
111
|
-
self.items[:] = (
|
112
|
-
self.button__add,
|
113
|
-
)
|
110
|
+
self.items[:] = (self.button__add,)
|
114
111
|
|
115
112
|
def __init__(self, *args, **kwargs):
|
116
113
|
kwargs.update(
|
@@ -122,13 +119,15 @@ class AvailableColumnsTree(ExtTree):
|
|
122
119
|
|
123
120
|
self.style = {'border-width': '1px'}
|
124
121
|
|
125
|
-
ColumnsConstructor.from_config(
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
122
|
+
ColumnsConstructor.from_config(
|
123
|
+
(
|
124
|
+
dict(
|
125
|
+
data_index='title',
|
126
|
+
header='Наименование',
|
127
|
+
sortable=False,
|
128
|
+
),
|
129
|
+
)
|
130
|
+
).configure_grid(self)
|
132
131
|
|
133
132
|
self.top_bar = self.ToolBar()
|
134
133
|
|
@@ -140,7 +139,6 @@ class ReportColumnsTree(ExtTree):
|
|
140
139
|
"""Дерево используемых в шаблоне отчета столбцов."""
|
141
140
|
|
142
141
|
class ToolBar(ExtToolBar):
|
143
|
-
|
144
142
|
def __init__(self, *args, **kwargs):
|
145
143
|
super(ReportColumnsTree.ToolBar, self).__init__(*args, **kwargs)
|
146
144
|
|
@@ -160,19 +158,13 @@ class ReportColumnsTree(ExtTree):
|
|
160
158
|
|
161
159
|
# Промежуточный итог
|
162
160
|
self.button__by_value_count = ExtContextMenuItem(
|
163
|
-
text='Количество',
|
164
|
-
icon_cls='icon-report-add',
|
165
|
-
handler='setByValueCountAggregator'
|
161
|
+
text='Количество', icon_cls='icon-report-add', handler='setByValueCountAggregator'
|
166
162
|
)
|
167
163
|
self.button__by_value_sum = ExtContextMenuItem(
|
168
|
-
text='Сумма',
|
169
|
-
icon_cls='icon-report-add',
|
170
|
-
handler='setByValueSumAggregator'
|
164
|
+
text='Сумма', icon_cls='icon-report-add', handler='setByValueSumAggregator'
|
171
165
|
)
|
172
166
|
self.button__by_value_none = ExtContextMenuItem(
|
173
|
-
text='Очистить',
|
174
|
-
icon_cls='icon-report-delete',
|
175
|
-
handler='setByValueNoneAggregator'
|
167
|
+
text='Очистить', icon_cls='icon-report-delete', handler='setByValueNoneAggregator'
|
176
168
|
)
|
177
169
|
context_menu__by_value = ExtContextMenu()
|
178
170
|
context_menu__by_value.items.extend(
|
@@ -183,7 +175,7 @@ class ReportColumnsTree(ExtTree):
|
|
183
175
|
)
|
184
176
|
)
|
185
177
|
self.menu__by_value = ExtToolbarMenu(
|
186
|
-
icon_cls=
|
178
|
+
icon_cls='icon-report',
|
187
179
|
menu=context_menu__by_value,
|
188
180
|
text='Промежуточный итог',
|
189
181
|
hidden=True,
|
@@ -191,24 +183,16 @@ class ReportColumnsTree(ExtTree):
|
|
191
183
|
|
192
184
|
# Итог
|
193
185
|
self.button__total_count = ExtContextMenuItem(
|
194
|
-
text='Количество',
|
195
|
-
icon_cls='icon-calculator-add',
|
196
|
-
handler='setTotalCountAggregator'
|
186
|
+
text='Количество', icon_cls='icon-calculator-add', handler='setTotalCountAggregator'
|
197
187
|
)
|
198
188
|
self.button__total_uniq_count = ExtContextMenuItem(
|
199
|
-
text='Количество уникальных',
|
200
|
-
icon_cls='icon-calculator-add',
|
201
|
-
handler='setTotalCountUniqueAggregator'
|
189
|
+
text='Количество уникальных', icon_cls='icon-calculator-add', handler='setTotalCountUniqueAggregator'
|
202
190
|
)
|
203
191
|
self.button__total_sum = ExtContextMenuItem(
|
204
|
-
text='Сумма',
|
205
|
-
icon_cls='icon-calculator-add',
|
206
|
-
handler='setTotalSumAggregator'
|
192
|
+
text='Сумма', icon_cls='icon-calculator-add', handler='setTotalSumAggregator'
|
207
193
|
)
|
208
194
|
self.button__total_none = ExtContextMenuItem(
|
209
|
-
text='Очистить',
|
210
|
-
icon_cls='icon-calculator-delete',
|
211
|
-
handler='setTotalNoneAggregator'
|
195
|
+
text='Очистить', icon_cls='icon-calculator-delete', handler='setTotalNoneAggregator'
|
212
196
|
)
|
213
197
|
context_menu__total = ExtContextMenu()
|
214
198
|
context_menu__total.items.extend(
|
@@ -220,7 +204,7 @@ class ReportColumnsTree(ExtTree):
|
|
220
204
|
)
|
221
205
|
)
|
222
206
|
self.menu__total = ExtToolbarMenu(
|
223
|
-
icon_cls=
|
207
|
+
icon_cls='icon-calculator',
|
224
208
|
menu=context_menu__total,
|
225
209
|
text='Итог',
|
226
210
|
hidden=True,
|
@@ -244,46 +228,42 @@ class ReportColumnsTree(ExtTree):
|
|
244
228
|
|
245
229
|
self.style = {'border-width': '1px'}
|
246
230
|
|
247
|
-
ColumnsConstructor.from_config(
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
data_index='visible',
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
width=20,
|
284
|
-
fixed=True,
|
285
|
-
),
|
286
|
-
)).configure_grid(self)
|
231
|
+
ColumnsConstructor.from_config(
|
232
|
+
(
|
233
|
+
dict(
|
234
|
+
data_index='title',
|
235
|
+
header='Наименование',
|
236
|
+
sortable=False,
|
237
|
+
),
|
238
|
+
dict(data_index='visible', hidden=True),
|
239
|
+
dict(
|
240
|
+
data_index='visible_title',
|
241
|
+
header='Отображать',
|
242
|
+
sortable=False,
|
243
|
+
width=20,
|
244
|
+
fixed=True,
|
245
|
+
),
|
246
|
+
dict(data_index='by_value', hidden=True),
|
247
|
+
dict(
|
248
|
+
data_index='by_value_title',
|
249
|
+
header='Промежуточный итог',
|
250
|
+
sortable=False,
|
251
|
+
width=20,
|
252
|
+
fixed=True,
|
253
|
+
),
|
254
|
+
dict(
|
255
|
+
data_index='total',
|
256
|
+
hidden=True,
|
257
|
+
),
|
258
|
+
dict(
|
259
|
+
data_index='total_title',
|
260
|
+
header='Итог',
|
261
|
+
sortable=False,
|
262
|
+
width=20,
|
263
|
+
fixed=True,
|
264
|
+
),
|
265
|
+
)
|
266
|
+
).configure_grid(self)
|
287
267
|
|
288
268
|
self.top_bar = self.ToolBar()
|
289
269
|
|
@@ -328,6 +308,8 @@ class ColumnsTab(WindowTab):
|
|
328
308
|
self.grid__report_columns.set_params(params)
|
329
309
|
self.grid__report_columns.drag_drop = True
|
330
310
|
self.grid__report_columns.handler_beforedrop = 'onBeforeDrop'
|
311
|
+
|
312
|
+
|
331
313
|
# -----------------------------------------------------------------------------
|
332
314
|
# Вкладка "Фильтры" окна редактирования шаблона.
|
333
315
|
|
@@ -360,9 +342,7 @@ class OperatorPanel(ExtFieldSet):
|
|
360
342
|
self.hidden = True
|
361
343
|
self.field__operator.value = 'AND'
|
362
344
|
|
363
|
-
self.items[:] = (
|
364
|
-
self.field__operator,
|
365
|
-
)
|
345
|
+
self.items[:] = (self.field__operator,)
|
366
346
|
|
367
347
|
|
368
348
|
class FilterParamsPanel(ExtContainerTable):
|
@@ -387,9 +367,7 @@ class FilterParamsPanel(ExtContainerTable):
|
|
387
367
|
label='Условие',
|
388
368
|
data=(), # ReportFilter.OPERATOR_CHOICES,
|
389
369
|
)
|
390
|
-
self.field__operator.store.id_property =
|
391
|
-
self.field__operator.value_field
|
392
|
-
)
|
370
|
+
self.field__operator.store.id_property = self.field__operator.value_field
|
393
371
|
|
394
372
|
self.field__exclude = ExtCheckBox(
|
395
373
|
name='exclude',
|
@@ -549,6 +527,8 @@ class FiltersTab(WindowTab):
|
|
549
527
|
self.panel__filter_params.flex = 0
|
550
528
|
self.panel__filter_params.height = 120
|
551
529
|
self.grid__filters.flex = 1
|
530
|
+
|
531
|
+
|
552
532
|
# -----------------------------------------------------------------------------
|
553
533
|
# Вкладка "Сортировка" окна редактирования шаблона.
|
554
534
|
|
@@ -654,9 +634,7 @@ class SortingParamsPanel(ExtFieldSet):
|
|
654
634
|
data=constants.DIRECTION_CHOICES,
|
655
635
|
anchor='100%',
|
656
636
|
)
|
657
|
-
self.field__direction.store.id_property =
|
658
|
-
self.field__direction.value_field
|
659
|
-
)
|
637
|
+
self.field__direction.store.id_property = self.field__direction.value_field
|
660
638
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
661
639
|
|
662
640
|
self.items[:] = (
|
@@ -693,6 +671,8 @@ class SortingTab(WindowTab):
|
|
693
671
|
self.grid__sorting.flex = 1
|
694
672
|
self.panel__sorting_params.flex = 0
|
695
673
|
self.panel__sorting_params.height = 80
|
674
|
+
|
675
|
+
|
696
676
|
# -----------------------------------------------------------------------------
|
697
677
|
|
698
678
|
|
@@ -729,8 +709,7 @@ class EditWindow(TabbedEditWindow):
|
|
729
709
|
anchor='100%',
|
730
710
|
)
|
731
711
|
self.field__include_available_units = _create_control_for_field(
|
732
|
-
getattr(ReportTemplate, '_meta').get_field(
|
733
|
-
'include_available_units'),
|
712
|
+
getattr(ReportTemplate, '_meta').get_field('include_available_units'),
|
734
713
|
anchor='100%',
|
735
714
|
)
|
736
715
|
|
@@ -763,10 +742,9 @@ class EditWindow(TabbedEditWindow):
|
|
763
742
|
self.height, self.width = 600, 1000
|
764
743
|
self.template_globals = local_template('edit-window.js')
|
765
744
|
|
766
|
-
self.field__data_source_name.store = ExtDataStore(
|
767
|
-
(name, data_source_param.title)
|
768
|
-
|
769
|
-
))
|
745
|
+
self.field__data_source_name.store = ExtDataStore(
|
746
|
+
tuple((name, data_source_param.title) for name, data_source_param in params['data_sources_params'])
|
747
|
+
)
|
770
748
|
self.field__data_source_name.store.id_property = 'name'
|
771
749
|
self.field__data_source_name.store.reader.set_fields('title')
|
772
750
|
|
@@ -8,9 +8,10 @@ class DataSourceParamsNotFound(ReportConstructorException):
|
|
8
8
|
def __init__(self, data_source_name):
|
9
9
|
self.data_source_name = data_source_name
|
10
10
|
|
11
|
-
super(
|
12
|
-
'
|
13
|
-
|
11
|
+
super().__init__(
|
12
|
+
'Параметры для источника данных с именем "{}" не зарегистрированы в системе.'.format(
|
13
|
+
self.data_source_name.name
|
14
|
+
)
|
14
15
|
)
|
15
16
|
|
16
17
|
|
@@ -21,13 +22,6 @@ class FilterError(ReportConstructorException):
|
|
21
22
|
self.report_filter = report_filter
|
22
23
|
|
23
24
|
if not message:
|
24
|
-
message = (
|
25
|
-
'Ошибка в фильтре для столбца {}'
|
26
|
-
.format(self.report_filter.column.title)
|
27
|
-
)
|
25
|
+
message = 'Ошибка в фильтре для столбца {}'.format(self.report_filter.column.title)
|
28
26
|
|
29
|
-
super(
|
30
|
-
'Ошибка в фильтре для столбца {}: {}'.format(
|
31
|
-
self.report_filter.column.title, message
|
32
|
-
)
|
33
|
-
)
|
27
|
+
super().__init__('Ошибка в фильтре для столбца {}: {}'.format(self.report_filter.column.title, message))
|
@@ -10,7 +10,6 @@ import educommon.report.constructor.validators
|
|
10
10
|
|
11
11
|
|
12
12
|
class Migration(migrations.Migration):
|
13
|
-
|
14
13
|
initial = True
|
15
14
|
|
16
15
|
dependencies = []
|
@@ -19,59 +18,49 @@ class Migration(migrations.Migration):
|
|
19
18
|
migrations.CreateModel(
|
20
19
|
name='ReportColumn',
|
21
20
|
fields=[
|
22
|
-
('id', models.AutoField(
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
verbose_name='ID')),
|
27
|
-
('name', models.CharField(
|
28
|
-
max_length=300,
|
29
|
-
verbose_name='Имя столбца в источнике данных')),
|
30
|
-
('index', models.PositiveSmallIntegerField(
|
31
|
-
verbose_name='Порядковый номер')),
|
32
|
-
('title', models.CharField(
|
33
|
-
blank=True,
|
34
|
-
max_length=300,
|
35
|
-
null=True,
|
36
|
-
verbose_name='Отображаемое имя')),
|
21
|
+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
22
|
+
('name', models.CharField(max_length=300, verbose_name='Имя столбца в источнике данных')),
|
23
|
+
('index', models.PositiveSmallIntegerField(verbose_name='Порядковый номер')),
|
24
|
+
('title', models.CharField(blank=True, max_length=300, null=True, verbose_name='Отображаемое имя')),
|
37
25
|
],
|
38
26
|
options={
|
39
|
-
'ordering': ('index',
|
27
|
+
'ordering': ('index',),
|
40
28
|
'verbose_name': 'Столбец отчета',
|
41
29
|
'verbose_name_plural': 'Столбцы отчетов',
|
42
|
-
},
|
30
|
+
},
|
31
|
+
),
|
43
32
|
migrations.CreateModel(
|
44
33
|
name='ReportTemplate',
|
45
34
|
fields=[
|
46
|
-
('id', models.AutoField(
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
35
|
+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
36
|
+
('title', models.CharField(max_length=1000, unique=True, verbose_name='Наименование шаблона отчета')),
|
37
|
+
(
|
38
|
+
'data_source_name',
|
39
|
+
models.CharField(
|
40
|
+
max_length=500,
|
41
|
+
validators=[educommon.report.constructor.validators.validate_data_source_name],
|
42
|
+
verbose_name='Имя источника данных',
|
43
|
+
),
|
44
|
+
),
|
45
|
+
(
|
46
|
+
'format',
|
47
|
+
models.PositiveSmallIntegerField(
|
48
|
+
choices=[
|
49
|
+
(0, 'Спрашивать перед сборкой'),
|
50
|
+
(1, 'Excel (без объединения ячеек)'),
|
51
|
+
(2, 'Excel (с объединением ячеек)'),
|
52
|
+
],
|
53
|
+
default=0,
|
54
|
+
verbose_name='Формат сборки',
|
55
|
+
),
|
56
|
+
),
|
68
57
|
],
|
69
58
|
options={
|
70
59
|
'verbose_name': 'Отчет',
|
71
60
|
'verbose_name_plural': 'Отчеты',
|
72
61
|
},
|
73
|
-
bases=(educommon.m3.extensions.listeners.delete_check.mixins.
|
74
|
-
|
62
|
+
bases=(educommon.m3.extensions.listeners.delete_check.mixins.CascadeDeleteMixin, models.Model),
|
63
|
+
),
|
75
64
|
migrations.AddField(
|
76
65
|
model_name='reportcolumn',
|
77
66
|
name='report_template',
|
@@ -79,8 +68,11 @@ class Migration(migrations.Migration):
|
|
79
68
|
on_delete=django.db.models.deletion.CASCADE,
|
80
69
|
related_name='columns',
|
81
70
|
to='report_constructor.ReportTemplate',
|
82
|
-
verbose_name='Отчет'
|
71
|
+
verbose_name='Отчет',
|
72
|
+
),
|
73
|
+
),
|
83
74
|
migrations.AlterUniqueTogether(
|
84
75
|
name='reportcolumn',
|
85
|
-
unique_together=set([('report_template', 'name')]),
|
76
|
+
unique_together=set([('report_template', 'name')]),
|
77
|
+
),
|
86
78
|
]
|
@@ -9,93 +9,104 @@ from django.db import (
|
|
9
9
|
|
10
10
|
|
11
11
|
class Migration(migrations.Migration):
|
12
|
-
|
13
|
-
|
12
|
+
dependencies = [
|
13
|
+
('report_constructor', '0001_initial'),
|
14
|
+
]
|
14
15
|
|
15
16
|
operations = [
|
16
17
|
migrations.CreateModel(
|
17
18
|
name='ReportFilter',
|
18
19
|
fields=[
|
19
|
-
('id', models.AutoField(
|
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
|
-
|
20
|
+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
21
|
+
('index', models.PositiveSmallIntegerField(verbose_name='Порядковый номер')),
|
22
|
+
(
|
23
|
+
'operator',
|
24
|
+
models.PositiveSmallIntegerField(
|
25
|
+
choices=[
|
26
|
+
(1, 'Меньше или равно'),
|
27
|
+
(2, 'Меньше'),
|
28
|
+
(3, 'Равно'),
|
29
|
+
(4, 'Не равно'),
|
30
|
+
(5, 'Больше'),
|
31
|
+
(6, 'Больше или равно'),
|
32
|
+
(7, 'Пусто'),
|
33
|
+
(8, 'Не пусто'),
|
34
|
+
(9, 'Содержит'),
|
35
|
+
(10, 'Не содержит'),
|
36
|
+
(11, 'Начинается с'),
|
37
|
+
(12, 'Заканчивается на'),
|
38
|
+
(13, 'Между'),
|
39
|
+
(14, 'Равно одному из'),
|
40
|
+
],
|
41
|
+
verbose_name='Оператор сравнения',
|
42
|
+
),
|
43
|
+
),
|
44
|
+
('case_sensitive', models.NullBooleanField(verbose_name='Учет регистра')),
|
45
|
+
(
|
46
|
+
'values',
|
47
|
+
django.contrib.postgres.fields.ArrayField(
|
48
|
+
base_field=models.TextField(verbose_name='Значение'), size=None
|
49
|
+
),
|
50
|
+
),
|
51
|
+
('comment', models.TextField(blank=True, null=True, verbose_name='Описание фильтра')),
|
52
|
+
(
|
53
|
+
'column',
|
54
|
+
models.ForeignKey(
|
55
|
+
on_delete=django.db.models.deletion.CASCADE,
|
56
|
+
related_name='filters',
|
57
|
+
to='report_constructor.ReportColumn',
|
58
|
+
verbose_name='Столбец',
|
59
|
+
),
|
60
|
+
),
|
54
61
|
],
|
55
62
|
options={
|
56
|
-
'ordering': ('index',
|
63
|
+
'ordering': ('index',),
|
57
64
|
'verbose_name': 'Фильтр',
|
58
65
|
'verbose_name_plural': 'Фильтры',
|
59
|
-
},
|
66
|
+
},
|
67
|
+
),
|
60
68
|
migrations.CreateModel(
|
61
69
|
name='ReportFilterGroup',
|
62
70
|
fields=[
|
63
|
-
('id', models.AutoField(
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
71
|
+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
72
|
+
(
|
73
|
+
'operator',
|
74
|
+
models.PositiveSmallIntegerField(
|
75
|
+
choices=[(1, 'И'), (2, 'ИЛИ')],
|
76
|
+
help_text=('Логический оператор, объединяющий фильтры в группе'),
|
77
|
+
verbose_name='Логический оператор',
|
78
|
+
),
|
79
|
+
),
|
80
|
+
('lft', models.PositiveIntegerField(db_index=True, editable=False)),
|
81
|
+
('rght', models.PositiveIntegerField(db_index=True, editable=False)),
|
82
|
+
('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
|
83
|
+
('level', models.PositiveIntegerField(db_index=True, editable=False)),
|
84
|
+
(
|
85
|
+
'parent',
|
86
|
+
mptt.fields.TreeForeignKey(
|
87
|
+
blank=True,
|
88
|
+
null=True,
|
89
|
+
on_delete=django.db.models.deletion.CASCADE,
|
90
|
+
related_name='nested_groups',
|
91
|
+
to='report_constructor.ReportFilterGroup',
|
92
|
+
verbose_name='Родительская группа',
|
93
|
+
),
|
94
|
+
),
|
95
|
+
(
|
96
|
+
'report_template',
|
97
|
+
models.ForeignKey(
|
98
|
+
on_delete=django.db.models.deletion.CASCADE,
|
99
|
+
related_name='filter_groups',
|
100
|
+
to='report_constructor.ReportTemplate',
|
101
|
+
verbose_name='Отчет',
|
72
102
|
),
|
73
|
-
|
74
|
-
('lft', models.PositiveIntegerField(
|
75
|
-
db_index=True, editable=False)),
|
76
|
-
('rght', models.PositiveIntegerField(
|
77
|
-
db_index=True, editable=False)),
|
78
|
-
('tree_id', models.PositiveIntegerField(
|
79
|
-
db_index=True, editable=False)),
|
80
|
-
('level', models.PositiveIntegerField(
|
81
|
-
db_index=True, editable=False)),
|
82
|
-
('parent', mptt.fields.TreeForeignKey(
|
83
|
-
blank=True,
|
84
|
-
null=True,
|
85
|
-
on_delete=django.db.models.deletion.CASCADE,
|
86
|
-
related_name='nested_groups',
|
87
|
-
to='report_constructor.ReportFilterGroup',
|
88
|
-
verbose_name='Родительская группа')),
|
89
|
-
('report_template', models.ForeignKey(
|
90
|
-
on_delete=django.db.models.deletion.CASCADE,
|
91
|
-
related_name='filter_groups',
|
92
|
-
to='report_constructor.ReportTemplate',
|
93
|
-
verbose_name='Отчет')),
|
103
|
+
),
|
94
104
|
],
|
95
105
|
options={
|
96
106
|
'verbose_name': 'Группа фильтров',
|
97
107
|
'verbose_name_plural': 'Группы фильтров',
|
98
|
-
},
|
108
|
+
},
|
109
|
+
),
|
99
110
|
migrations.AddField(
|
100
111
|
model_name='reportfilter',
|
101
112
|
name='group',
|
@@ -103,8 +114,11 @@ class Migration(migrations.Migration):
|
|
103
114
|
on_delete=django.db.models.deletion.CASCADE,
|
104
115
|
related_name='filters',
|
105
116
|
to='report_constructor.ReportFilterGroup',
|
106
|
-
verbose_name='Группа фильтров'
|
117
|
+
verbose_name='Группа фильтров',
|
118
|
+
),
|
119
|
+
),
|
107
120
|
migrations.AlterUniqueTogether(
|
108
121
|
name='reportfilter',
|
109
|
-
unique_together=set([('column', 'index')]),
|
122
|
+
unique_together=set([('column', 'index')]),
|
123
|
+
),
|
110
124
|
]
|
@@ -5,14 +5,14 @@ from django.db import (
|
|
5
5
|
|
6
6
|
|
7
7
|
class Migration(migrations.Migration):
|
8
|
-
|
9
|
-
|
8
|
+
dependencies = [
|
9
|
+
('report_constructor', '0002_report_filters'),
|
10
|
+
]
|
10
11
|
|
11
12
|
operations = [
|
12
13
|
migrations.AddField(
|
13
14
|
model_name='reportfilter',
|
14
15
|
name='exclude',
|
15
|
-
field=models.BooleanField(
|
16
|
-
|
17
|
-
verbose_name='Исключать записи, удовлетворяющие условию'), ),
|
16
|
+
field=models.BooleanField(default=False, verbose_name='Исключать записи, удовлетворяющие условию'),
|
17
|
+
),
|
18
18
|
]
|