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.
Files changed (221) hide show
  1. educommon/__init__.py +0 -1
  2. educommon/about/ui/actions.py +16 -30
  3. educommon/about/ui/ui.py +3 -12
  4. educommon/about/utils.py +6 -5
  5. educommon/async_task/__init__.py +0 -1
  6. educommon/async_task/actions.py +18 -13
  7. educommon/async_task/apps.py +4 -0
  8. educommon/async_task/locker.py +2 -5
  9. educommon/async_task/migrations/0001_initial.py +55 -9
  10. educommon/async_task/migrations/0002_task_type_and_status_data.py +94 -89
  11. educommon/async_task/migrations/0003_alter_runningtask_options.py +0 -1
  12. educommon/async_task/models.py +9 -6
  13. educommon/async_task/tasks.py +11 -7
  14. educommon/async_task/ui.py +16 -35
  15. educommon/async_tasks/__init__.py +0 -1
  16. educommon/async_tasks/apps.py +4 -0
  17. educommon/async_tasks/locks.py +11 -21
  18. educommon/async_tasks/migrations/0001_initial.py +68 -8
  19. educommon/async_tasks/migrations/0002_load_initial_data.py +0 -1
  20. educommon/async_tasks/models.py +9 -29
  21. educommon/async_tasks/tasks.py +25 -54
  22. educommon/audit_log/__init__.py +1 -0
  23. educommon/audit_log/actions.py +27 -36
  24. educommon/audit_log/app_meta.py +7 -4
  25. educommon/audit_log/apps.py +44 -29
  26. educommon/audit_log/constants.py +7 -4
  27. educommon/audit_log/error_log/actions.py +1 -3
  28. educommon/audit_log/helpers.py +2 -4
  29. educommon/audit_log/management/commands/reinstall_audit_log.py +11 -7
  30. educommon/audit_log/migrations/0001_initial.py +91 -16
  31. educommon/audit_log/migrations/0002_install_audit_log.py +13 -13
  32. educommon/audit_log/migrations/0003_logproxy.py +1 -3
  33. educommon/audit_log/migrations/0004_reinstall_audit_log.py +1 -4
  34. educommon/audit_log/migrations/0005_postgresql_error.py +4 -2
  35. educommon/audit_log/migrations/0006_auto_20200806_1707.py +3 -4
  36. educommon/audit_log/migrations/0007_create_selective_tables_function.py +8 -5
  37. educommon/audit_log/migrations/0008_table_logged.py +0 -1
  38. educommon/audit_log/migrations/0009_reinstall_audit_log.py +0 -1
  39. educommon/audit_log/models.py +36 -42
  40. educommon/audit_log/permissions.py +11 -9
  41. educommon/audit_log/proxies.py +12 -23
  42. educommon/audit_log/ui.py +18 -15
  43. educommon/audit_log/utils/__init__.py +28 -60
  44. educommon/audit_log/utils/operations.py +16 -2
  45. educommon/auth/__init__.py +0 -3
  46. educommon/auth/rbac/__init__.py +2 -4
  47. educommon/auth/rbac/actions.py +148 -145
  48. educommon/auth/rbac/app_meta.py +9 -6
  49. educommon/auth/rbac/backends/base.py +2 -8
  50. educommon/auth/rbac/backends/caching.py +27 -37
  51. educommon/auth/rbac/backends/simple.py +1 -4
  52. educommon/auth/rbac/checker.py +1 -3
  53. educommon/auth/rbac/management/commands/rbac.py +6 -11
  54. educommon/auth/rbac/manager.py +18 -47
  55. educommon/auth/rbac/migrations/0001_initial.py +73 -12
  56. educommon/auth/rbac/migrations/0002_model_modifier_metaclass_fix.py +7 -6
  57. educommon/auth/rbac/migrations/0003_permission_hidden.py +1 -5
  58. educommon/auth/rbac/migrations/0004_auto_20171024_1245.py +26 -19
  59. educommon/auth/rbac/models.py +63 -68
  60. educommon/auth/rbac/permissions.py +6 -7
  61. educommon/auth/rbac/ui.py +83 -84
  62. educommon/auth/rbac/utils.py +10 -11
  63. educommon/auth/rbac/validators.py +4 -5
  64. educommon/auth/simple_auth/__init__.py +1 -5
  65. educommon/auth/simple_auth/actions.py +79 -92
  66. educommon/auth/simple_auth/app_meta.py +2 -9
  67. educommon/auth/simple_auth/checkers.py +3 -3
  68. educommon/auth/simple_auth/migrations/0001_initial.py +23 -4
  69. educommon/auth/simple_auth/validators.py +0 -1
  70. educommon/contingent/actions.py +7 -7
  71. educommon/contingent/app_meta.py +1 -4
  72. educommon/contingent/base.py +10 -15
  73. educommon/contingent/catalogs.py +424 -540
  74. educommon/contingent/contingent_plugin/actions.py +4 -15
  75. educommon/contingent/contingent_plugin/apps.py +10 -4
  76. educommon/contingent/contingent_plugin/migrations/0001_initial.py +5 -6
  77. educommon/contingent/contingent_plugin/migrations/0002_add_contingent_model_deleted.py +6 -11
  78. educommon/contingent/contingent_plugin/model_views.py +2 -12
  79. educommon/contingent/contingent_plugin/models.py +2 -7
  80. educommon/contingent/contingent_plugin/observer.py +14 -13
  81. educommon/contingent/contingent_plugin/plugin_meta.py +1 -3
  82. educommon/contingent/contingent_plugin/storage.py +8 -7
  83. educommon/contingent/contingent_plugin/utils.py +6 -6
  84. educommon/django/db/fields.py +72 -86
  85. educommon/django/db/migration/__init__.py +3 -7
  86. educommon/django/db/migration/operations.py +29 -51
  87. educommon/django/db/mixins/__init__.py +16 -10
  88. educommon/django/db/mixins/date_interval.py +47 -75
  89. educommon/django/db/mixins/validation.py +26 -26
  90. educommon/django/db/model_view/__init__.py +18 -22
  91. educommon/django/db/models.py +9 -8
  92. educommon/django/db/observer.py +9 -27
  93. educommon/django/db/partitioning/__init__.py +66 -92
  94. educommon/django/db/partitioning/management/commands/apply_partitioning.py +3 -13
  95. educommon/django/db/partitioning/management/commands/clear_table.py +18 -14
  96. educommon/django/db/partitioning/management/commands/split_table.py +18 -13
  97. educommon/django/db/routers.py +6 -15
  98. educommon/django/db/signals.py +149 -2
  99. educommon/django/db/utils.py +14 -19
  100. educommon/django/db/validators/__init__.py +1 -0
  101. educommon/django/db/validators/simple.py +72 -100
  102. educommon/django/storages/atcfs/api.py +39 -53
  103. educommon/django/storages/atcfs/app_meta.py +1 -1
  104. educommon/django/storages/atcfs/management/commands/atcfs_migrate.py +42 -55
  105. educommon/django/storages/atcfs/models.py +0 -3
  106. educommon/django/storages/atcfs/monkey_patching.py +18 -12
  107. educommon/django/storages/atcfs/storage.py +14 -23
  108. educommon/extjs/fields/input_params.py +15 -45
  109. educommon/importer/XLSReader.py +143 -241
  110. educommon/importer/__init__.py +86 -4
  111. educommon/importer/api.py +53 -84
  112. educommon/importer/constants.py +4 -14
  113. educommon/importer/loggers.py +16 -26
  114. educommon/importer/proxy.py +131 -176
  115. educommon/importer/proxy_import.py +11 -12
  116. educommon/importer/report.py +4 -6
  117. educommon/importer/ui.py +32 -26
  118. educommon/importer/validators.py +4 -7
  119. educommon/integration_entities/helpers.py +14 -18
  120. educommon/ioc/__init__.py +3 -6
  121. educommon/logger/loggers.py +10 -14
  122. educommon/m3/__init__.py +20 -38
  123. educommon/m3/extensions/__init__.py +1 -0
  124. educommon/m3/extensions/listeners/__init__.py +22 -38
  125. educommon/m3/extensions/listeners/delete_check/listeners.py +31 -41
  126. educommon/m3/extensions/listeners/delete_check/mixins.py +20 -25
  127. educommon/m3/extensions/listeners/delete_check/signals.py +2 -2
  128. educommon/m3/extensions/listeners/delete_check/ui.py +15 -14
  129. educommon/m3/extensions/listeners/delete_check/utils.py +9 -11
  130. educommon/m3/extensions/ui.py +15 -33
  131. educommon/m3/transaction_context.py +17 -19
  132. educommon/objectpack/actions.py +70 -88
  133. educommon/objectpack/apps.py +5 -0
  134. educommon/objectpack/filters.py +9 -15
  135. educommon/objectpack/ui.py +59 -77
  136. educommon/report/__init__.py +9 -5
  137. educommon/report/actions.py +29 -32
  138. educommon/report/constructor/__init__.py +5 -8
  139. educommon/report/constructor/app_meta.py +1 -3
  140. educommon/report/constructor/apps.py +1 -0
  141. educommon/report/constructor/base.py +33 -80
  142. educommon/report/constructor/builders/excel/_base.py +138 -286
  143. educommon/report/constructor/builders/excel/_header.py +2 -9
  144. educommon/report/constructor/builders/excel/product.py +13 -34
  145. educommon/report/constructor/builders/excel/with_merged_cells.py +18 -14
  146. educommon/report/constructor/config.py +2 -0
  147. educommon/report/constructor/editor/actions.py +101 -215
  148. educommon/report/constructor/editor/ui.py +71 -93
  149. educommon/report/constructor/exceptions.py +6 -12
  150. educommon/report/constructor/migrations/0001_initial.py +36 -44
  151. educommon/report/constructor/migrations/0002_report_filters.py +86 -72
  152. educommon/report/constructor/migrations/0003_reportfilter_exclude.py +5 -5
  153. educommon/report/constructor/migrations/0004_reportfilter_fields.py +22 -18
  154. educommon/report/constructor/migrations/0005_reportcolumn_visible.py +5 -4
  155. educommon/report/constructor/migrations/0006_reportsorting.py +21 -17
  156. educommon/report/constructor/migrations/0007_include_available_units.py +14 -14
  157. educommon/report/constructor/migrations/0008_auto_20170407_1318.py +4 -5
  158. educommon/report/constructor/migrations/0009_auto_20180405_0642.py +1 -4
  159. educommon/report/constructor/migrations/0010_add_aggregate_fields.py +7 -8
  160. educommon/report/constructor/mixins.py +14 -15
  161. educommon/report/constructor/models.py +76 -124
  162. educommon/report/constructor/utils.py +3 -8
  163. educommon/report/constructor/validators.py +1 -3
  164. educommon/report/reporter.py +25 -43
  165. educommon/report/utils.py +14 -40
  166. educommon/rest/actions.py +7 -11
  167. educommon/rest/context.py +6 -16
  168. educommon/rest/controllers.py +10 -10
  169. educommon/rest/mixins.py +29 -27
  170. educommon/secure_media/app_meta.py +9 -9
  171. educommon/utils/__init__.py +3 -2
  172. educommon/utils/caching.py +1 -3
  173. educommon/utils/conversion.py +1 -3
  174. educommon/utils/crypto.py +1 -2
  175. educommon/utils/date.py +13 -26
  176. educommon/utils/db/__init__.py +17 -26
  177. educommon/utils/db/postgresql.py +1 -4
  178. educommon/utils/fonts/__init__.py +3 -4
  179. educommon/utils/licence/__init__.py +5 -16
  180. educommon/utils/misc.py +9 -18
  181. educommon/utils/object_grid.py +55 -62
  182. educommon/utils/phone_number/modelfields.py +1 -3
  183. educommon/utils/phone_number/phone_number.py +5 -8
  184. educommon/utils/phone_number/validators.py +8 -23
  185. educommon/utils/plugins.py +15 -28
  186. educommon/utils/registry.py +2 -1
  187. educommon/utils/seqtools.py +1 -3
  188. educommon/utils/serializer.py +9 -16
  189. educommon/utils/storage.py +3 -2
  190. educommon/utils/system.py +1 -3
  191. educommon/utils/system_app/management/commands/delete_objects.py +17 -34
  192. educommon/utils/ui.py +87 -84
  193. educommon/utils/xml/__init__.py +2 -7
  194. educommon/utils/xml/resolver.py +1 -0
  195. educommon/ws_log/actions.py +31 -76
  196. educommon/ws_log/base.py +6 -20
  197. educommon/ws_log/migrations/0001_initial.py +25 -8
  198. educommon/ws_log/migrations/0002_auto_20160628_1334.py +0 -1
  199. educommon/ws_log/migrations/0003_add_fields_to_smev_logs.py +20 -4
  200. educommon/ws_log/migrations/0004_auto_20160727_1600.py +7 -6
  201. educommon/ws_log/migrations/0005_auto_20161130_1615.py +14 -4
  202. educommon/ws_log/migrations/0006_auto_20170327_1027.py +3 -2
  203. educommon/ws_log/migrations/0007_auto_20180607_1040.py +8 -9
  204. educommon/ws_log/migrations/0008_auto_20180713_1445.py +23 -10
  205. educommon/ws_log/migrations/0009_auto_20201130_1553.py +7 -2
  206. educommon/ws_log/models.py +21 -35
  207. educommon/ws_log/provider.py +2 -1
  208. educommon/ws_log/report.py +8 -13
  209. educommon/ws_log/smev/applications.py +12 -27
  210. educommon/ws_log/smev/exceptions.py +2 -3
  211. educommon/ws_log/ui.py +32 -32
  212. educommon/ws_log/utils.py +1 -3
  213. educommon-3.13.2.dist-info/METADATA +57 -0
  214. educommon-3.13.2.dist-info/RECORD +354 -0
  215. {educommon-3.12.0.dist-info → educommon-3.13.2.dist-info}/WHEEL +1 -1
  216. educommon/utils/patches.py +0 -27
  217. educommon/version.conf +0 -11
  218. educommon-3.12.0.dist-info/METADATA +0 -47
  219. educommon-3.12.0.dist-info/RECORD +0 -357
  220. educommon-3.12.0.dist-info/dependency_links.txt +0 -1
  221. {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
- dict(
127
- data_index='title',
128
- header='Наименование',
129
- sortable=False,
130
- ),
131
- )).configure_grid(self)
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="icon-report",
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="icon-calculator",
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
- dict(
249
- data_index='title',
250
- header='Наименование',
251
- sortable=False,
252
- ),
253
- dict(
254
- data_index='visible',
255
- hidden=True
256
- ),
257
- dict(
258
- data_index='visible_title',
259
- header='Отображать',
260
- sortable=False,
261
- width=20,
262
- fixed=True,
263
- ),
264
- dict(
265
- data_index='by_value',
266
- hidden=True
267
- ),
268
- dict(
269
- data_index='by_value_title',
270
- header='Промежуточный итог',
271
- sortable=False,
272
- width=20,
273
- fixed=True,
274
- ),
275
- dict(
276
- data_index='total',
277
- hidden=True,
278
- ),
279
- dict(
280
- data_index='total_title',
281
- header='Итог',
282
- sortable=False,
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(tuple(
767
- (name, data_source_param.title)
768
- for name, data_source_param in params['data_sources_params']
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(DataSourceParamsNotFound, self).__init__(
12
- '"Параметры для источника данных с именем "{}" не '
13
- 'зарегистрированы в системе.'.format(self.data_source_name.name)
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(FilterError, self).__init__(
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
- auto_created=True,
24
- primary_key=True,
25
- serialize=False,
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
- auto_created=True,
48
- primary_key=True,
49
- serialize=False,
50
- verbose_name='ID')),
51
- ('title', models.CharField(
52
- max_length=1000,
53
- unique=True,
54
- verbose_name='Наименование шаблона отчета')),
55
- ('data_source_name', models.CharField(
56
- max_length=500,
57
- validators=[
58
- educommon.report.constructor.validators.
59
- validate_data_source_name
60
- ],
61
- verbose_name='Имя источника данных')),
62
- ('format', models.PositiveSmallIntegerField(
63
- choices=[(0, 'Спрашивать перед сборкой'),
64
- (1, 'Excel (без объединения ячеек)'),
65
- (2, 'Excel (с объединением ячеек)')],
66
- default=0,
67
- verbose_name='Формат сборки')),
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
- CascadeDeleteMixin, models.Model), ),
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
- dependencies = [('report_constructor', '0001_initial'), ]
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
- auto_created=True,
21
- primary_key=True,
22
- serialize=False,
23
- verbose_name='ID')),
24
- ('index', models.PositiveSmallIntegerField(
25
- verbose_name='Порядковый номер')),
26
- ('operator', models.PositiveSmallIntegerField(
27
- choices=[(1, 'Меньше или равно'),
28
- (2, 'Меньше'),
29
- (3, 'Равно'),
30
- (4, 'Не равно'),
31
- (5, 'Больше'),
32
- (6, 'Больше или равно'),
33
- (7, 'Пусто'),
34
- (8, 'Не пусто'),
35
- (9, 'Содержит'),
36
- (10, 'Не содержит'),
37
- (11, 'Начинается с'),
38
- (12, 'Заканчивается на'),
39
- (13, 'Между'),
40
- (14, 'Равно одному из')],
41
- verbose_name='Оператор сравнения')),
42
- ('case_sensitive', models.NullBooleanField(
43
- verbose_name='Учет регистра')),
44
- ('values', django.contrib.postgres.fields.ArrayField(
45
- base_field=models.TextField(verbose_name='Значение'),
46
- size=None)),
47
- ('comment', models.TextField(
48
- blank=True, null=True, verbose_name='Описание фильтра')),
49
- ('column', models.ForeignKey(
50
- on_delete=django.db.models.deletion.CASCADE,
51
- related_name='filters',
52
- to='report_constructor.ReportColumn',
53
- verbose_name='Столбец')),
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
- auto_created=True,
65
- primary_key=True,
66
- serialize=False,
67
- verbose_name='ID')),
68
- ('operator', models.PositiveSmallIntegerField(
69
- choices=[(1, 'И'), (2, 'ИЛИ')],
70
- help_text=(
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
- verbose_name='Логический оператор')),
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
- dependencies = [('report_constructor', '0002_report_filters'), ]
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
- default=False,
17
- verbose_name='Исключать записи, удовлетворяющие условию'), ),
16
+ field=models.BooleanField(default=False, verbose_name='Исключать записи, удовлетворяющие условию'),
17
+ ),
18
18
  ]