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
@@ -1,4 +1,5 @@
1
1
  """Экшены и паки приложения логирования СМЭВ."""
2
+
2
3
  import datetime
3
4
  import functools
4
5
 
@@ -56,12 +57,14 @@ class SmevLogPack(ObjectPack):
56
57
  lookup=lambda d: Q(
57
58
  time__range=(
58
59
  datetime.datetime.combine(d, datetime.time.min),
59
- datetime.datetime.combine(d, datetime.time.max)
60
+ datetime.datetime.combine(d, datetime.time.max),
60
61
  )
61
- ) if d else Q(),
62
+ )
63
+ if d
64
+ else Q(),
62
65
  tooltip='Дата время',
63
66
  value=datetime.date.today(),
64
- allow_blank=False
67
+ allow_blank=False,
65
68
  ),
66
69
  'sortable': True,
67
70
  'sort_fields': ('time',),
@@ -69,8 +72,7 @@ class SmevLogPack(ObjectPack):
69
72
  {
70
73
  'data_index': 'service_address',
71
74
  'header': 'Адрес сервиса',
72
- 'filter': filter_field(
73
- 'service_address', 'service_address__icontains'),
75
+ 'filter': filter_field('service_address', 'service_address__icontains'),
74
76
  'sortable': True,
75
77
  'sort_fields': ('service_address',),
76
78
  },
@@ -80,8 +82,7 @@ class SmevLogPack(ObjectPack):
80
82
  'filter': ChoicesFilter(
81
83
  choices=models.SmevLog.CONSUMER_TYPES + ((ALL_TYPES, 'Все'),),
82
84
  parser=int,
83
- lookup=lambda index: Q(
84
- consumer_type=index) if index != ALL_TYPES else Q(),
85
+ lookup=lambda index: Q(consumer_type=index) if index != ALL_TYPES else Q(),
85
86
  tooltip='Потребитель сервиса',
86
87
  ),
87
88
  'sortable': True,
@@ -90,8 +91,7 @@ class SmevLogPack(ObjectPack):
90
91
  {
91
92
  'data_index': 'consumer_name',
92
93
  'header': 'Наименование потребителя',
93
- 'filter': filter_field(
94
- 'consumer_name', 'consumer_name__icontains'),
94
+ 'filter': filter_field('consumer_name', 'consumer_name__icontains'),
95
95
  'sortable': True,
96
96
  'sort_fields': ('consumer_name',),
97
97
  },
@@ -101,8 +101,7 @@ class SmevLogPack(ObjectPack):
101
101
  'filter': ChoicesFilter(
102
102
  choices=models.SmevLog.SOURCE_TYPES + ((ALL_TYPES, 'Все'),),
103
103
  parser=int,
104
- lookup=lambda index: Q(
105
- source=index) if index != ALL_TYPES else Q(),
104
+ lookup=lambda index: Q(source=index) if index != ALL_TYPES else Q(),
106
105
  tooltip='Источник взаимодействия',
107
106
  ),
108
107
  'sortable': True,
@@ -125,16 +124,14 @@ class SmevLogPack(ObjectPack):
125
124
  {
126
125
  'data_index': 'method_verbose_name',
127
126
  'header': 'Наименование метода',
128
- 'filter': filter_field(
129
- 'method_verbose_name', 'method_verbose_name__icontains'),
127
+ 'filter': filter_field('method_verbose_name', 'method_verbose_name__icontains'),
130
128
  'sortable': True,
131
129
  'sort_fields': ('method_verbose_name',),
132
130
  },
133
131
  {
134
132
  'data_index': 'result_with_default',
135
133
  'header': 'Результат',
136
- 'filter': text_field_filter(
137
- 'result', 'result_with_default__icontains'),
134
+ 'filter': text_field_filter('result', 'result_with_default__icontains'),
138
135
  'sortable': True,
139
136
  'sort_fields': ('result_with_default',),
140
137
  },
@@ -142,16 +139,14 @@ class SmevLogPack(ObjectPack):
142
139
  'data_index': 'interaction_type_verbose',
143
140
  'header': 'Вид взаимодействия',
144
141
  'filter': ChoicesFilter(
145
- choices=models.SmevLog.INTERACTION_TYPES + (
146
- (ALL_TYPES, 'Все'),),
142
+ choices=models.SmevLog.INTERACTION_TYPES + ((ALL_TYPES, 'Все'),),
147
143
  parser=int,
148
- lookup=lambda index: Q(
149
- interaction_type=index) if index != ALL_TYPES else Q(),
150
- tooltip='Вид взаимодействия'
144
+ lookup=lambda index: Q(interaction_type=index) if index != ALL_TYPES else Q(),
145
+ tooltip='Вид взаимодействия',
151
146
  ),
152
147
  'sortable': True,
153
148
  'sort_fields': ('interaction_type',),
154
- }
149
+ },
155
150
  ]
156
151
 
157
152
  # Название фильтра для столбца "Дата время" в ajax-запросе
@@ -164,23 +159,19 @@ class SmevLogPack(ObjectPack):
164
159
 
165
160
  def configure_grid(self, grid):
166
161
  """Настройка грида."""
167
- super(SmevLogPack, self).configure_grid(grid)
162
+ super().configure_grid(grid)
163
+
168
164
  grid.top_bar.button_edit.text = 'Просмотр'
169
165
 
170
- grid.store.base_params = {
171
- self.date_time_filter_param_name: str(datetime.date.today())
172
- }
166
+ grid.store.base_params = {self.date_time_filter_param_name: str(datetime.date.today())}
173
167
 
174
168
  def prepare_row(self, obj, request, context):
175
169
  """Настройка строки грида, вызывается посточно для каждой строки."""
176
- obj.interaction_type_verbose = (
177
- dict(self.model.INTERACTION_TYPES)[obj.interaction_type])
170
+ obj.interaction_type_verbose = dict(self.model.INTERACTION_TYPES)[obj.interaction_type]
178
171
 
179
- obj.consumer_type_verbose = (
180
- dict(self.model.CONSUMER_TYPES).get(obj.consumer_type, ''))
172
+ obj.consumer_type_verbose = dict(self.model.CONSUMER_TYPES).get(obj.consumer_type, '')
181
173
 
182
- obj.source_verbose = (
183
- dict(self.model.SOURCE_TYPES).get(obj.source, ''))
174
+ obj.source_verbose = dict(self.model.SOURCE_TYPES).get(obj.source, '')
184
175
 
185
176
  return obj
186
177
 
@@ -197,13 +188,7 @@ class SmevLogPack(ObjectPack):
197
188
  """Размещение в меню."""
198
189
  return menu.SubMenu(
199
190
  'Администрирование',
200
- menu.SubMenu(
201
- 'Взаимодействие со СМЭВ',
202
- menu.Item(
203
- 'Логи СМЭВ',
204
- pack=self.get_default_action()
205
- )
206
- )
191
+ menu.SubMenu('Взаимодействие со СМЭВ', menu.Item('Логи СМЭВ', pack=self.get_default_action())),
207
192
  )
208
193
 
209
194
 
@@ -215,59 +200,29 @@ class SmevProviderPack(PackValidationMixin, ObjectPack):
215
200
  list_window = ui.SmevProviderListWindow
216
201
 
217
202
  columns = [
218
- {
219
- 'data_index': 'mnemonics',
220
- 'header': 'Мнемоника',
221
- 'sortable': True,
222
- 'searchable': True,
223
- 'width': 1
224
- },
225
- {
226
- 'data_index': 'address',
227
- 'header': 'Адрес СМЭВ',
228
- 'sortable': True,
229
- 'searchable': True,
230
- 'width': 1
231
- },
203
+ {'data_index': 'mnemonics', 'header': 'Мнемоника', 'sortable': True, 'searchable': True, 'width': 1},
204
+ {'data_index': 'address', 'header': 'Адрес СМЭВ', 'sortable': True, 'searchable': True, 'width': 1},
232
205
  {
233
206
  'data_index': 'service_name',
234
207
  'header': 'Наименование электронного сервиса',
235
208
  'sortable': True,
236
209
  'searchable': True,
237
- 'width': 3
238
- },
239
- {
240
- 'data_index': 'source',
241
- 'header': 'Источник взаимодействия',
242
- 'sortable': True,
243
- 'searchable': True,
244
- 'width': 2
245
- },
246
- {
247
- 'data_index': 'entity',
248
- 'header': 'Наименование юр. лица',
249
- 'sortable': True,
250
- 'searchable': True,
251
- 'width': 2
210
+ 'width': 3,
252
211
  },
212
+ {'data_index': 'source', 'header': 'Источник взаимодействия', 'sortable': True, 'searchable': True, 'width': 2},
213
+ {'data_index': 'entity', 'header': 'Наименование юр. лица', 'sortable': True, 'searchable': True, 'width': 2},
253
214
  {
254
215
  'data_index': 'service_address_status_changes',
255
216
  'header': 'Адрес сервиса изменения статуса',
256
217
  'sortable': True,
257
218
  'searchable': True,
258
- 'width': 3
259
- }
219
+ 'width': 3,
220
+ },
260
221
  ]
261
222
 
262
223
  def extend_menu(self, menu):
263
224
  """Размещение в меню."""
264
225
  return menu.SubMenu(
265
226
  'Администрирование',
266
- menu.SubMenu(
267
- 'Взаимодействие со СМЭВ',
268
- menu.Item(
269
- 'Поставщики СМЭВ',
270
- pack=self.get_default_action()
271
- )
272
- )
227
+ menu.SubMenu('Взаимодействие со СМЭВ', menu.Item('Поставщики СМЭВ', pack=self.get_default_action())),
273
228
  )
educommon/ws_log/base.py CHANGED
@@ -50,11 +50,7 @@ class BaseWsApplicationLogger(metaclass=ABCMeta):
50
50
  :param traceback_data: Данные возникшей ошибки.
51
51
  """
52
52
  etype, value, tb = traceback_data
53
- traceback_text = str(
54
- ''.join(
55
- traceback.format_exception(etype, value, tb, None)
56
- )
57
- )
53
+ traceback_text = str(''.join(traceback.format_exception(etype, value, tb, None)))
58
54
  log_record.result = traceback_text
59
55
 
60
56
  def save_log_record(self, wsgi_app, uri, retval, traceback_data, environ):
@@ -112,9 +108,7 @@ class DefaultWsApplicationLogger(BaseWsApplicationLogger):
112
108
  log_model = ('ws_log', 'SmevLog')
113
109
 
114
110
  def _prepare_log_record(self):
115
- log_object = super(
116
- DefaultWsApplicationLogger, self
117
- )._prepare_log_record()
111
+ log_object = super()._prepare_log_record()
118
112
  log_object.direction = self.log_model.INCOMING
119
113
  log_object.interaction_type = self.log_model.IS_NOT_SMEV
120
114
  return log_object
@@ -142,9 +136,7 @@ class DefaultWsApplicationLogger(BaseWsApplicationLogger):
142
136
  log_record = ctx.transport.req['log_record']
143
137
 
144
138
  if ctx.descriptor and ctx.descriptor.service_class:
145
- method_info = (ctx.descriptor
146
- .service_class
147
- .METHOD_VERBOSE_NAMES[ctx.method_name])
139
+ method_info = ctx.descriptor.service_class.METHOD_VERBOSE_NAMES[ctx.method_name]
148
140
 
149
141
  log_record.method_name = ctx.method_name
150
142
  log_record.method_verbose_name = method_info['method_verbose_name']
@@ -156,8 +148,7 @@ class DefaultWsApplicationLogger(BaseWsApplicationLogger):
156
148
  mnemonic = ctx.udc.in_smev_message.Service.Mnemonic
157
149
  address = req_env['HTTP_HOST'] + req_env['PATH_INFO']
158
150
 
159
- smev_providers = SmevProvider.objects.filter(
160
- mnemonics=mnemonic, address=address)[:1]
151
+ smev_providers = SmevProvider.objects.filter(mnemonics=mnemonic, address=address)[:1]
161
152
 
162
153
  if smev_providers.exists():
163
154
  log_record.consumer_name = smev_providers[0].mnemonics
@@ -165,16 +156,11 @@ class DefaultWsApplicationLogger(BaseWsApplicationLogger):
165
156
  if interaction_type == SmevLog.IS_SMEV:
166
157
  log_record.source = smev_providers[0].source
167
158
 
168
- log_record.target_name = (
169
- smev_providers[0].service_name
170
- )
159
+ log_record.target_name = smev_providers[0].service_name
171
160
 
172
161
  if interaction_type is None:
173
162
  protocol = method_info.get('protocol', '')
174
- interaction_type = (
175
- SmevLog.IS_SMEV
176
- if protocol.find('smev') != -1
177
- else SmevLog.IS_NOT_SMEV)
163
+ interaction_type = SmevLog.IS_SMEV if protocol.find('smev') != -1 else SmevLog.IS_NOT_SMEV
178
164
 
179
165
  log_record.interaction_type = interaction_type
180
166
 
@@ -7,26 +7,40 @@ from django.db import (
7
7
 
8
8
 
9
9
  class Migration(migrations.Migration):
10
-
11
10
  initial = True
12
11
 
13
- dependencies = [
14
- ]
12
+ dependencies = []
15
13
 
16
14
  operations = [
17
15
  migrations.CreateModel(
18
16
  name='SmevLog',
19
17
  fields=[
20
18
  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
21
- ('service_address', models.CharField(blank=True, max_length=250, null=True, verbose_name='Адрес сервиса')),
19
+ (
20
+ 'service_address',
21
+ models.CharField(blank=True, max_length=250, null=True, verbose_name='Адрес сервиса'),
22
+ ),
22
23
  ('method_name', models.CharField(blank=True, max_length=250, null=True, verbose_name='Код метода')),
23
- ('method_verbose_name', models.CharField(blank=True, max_length=250, null=True, verbose_name='Наименование метода')),
24
+ (
25
+ 'method_verbose_name',
26
+ models.CharField(blank=True, max_length=250, null=True, verbose_name='Наименование метода'),
27
+ ),
24
28
  ('request', models.TextField(blank=True, null=True, verbose_name='SOAP запрос')),
25
29
  ('response', models.TextField(blank=True, null=True, verbose_name='SOAP ответ')),
26
30
  ('error', models.TextField(blank=True, null=True, verbose_name='Возникшая ошибка')),
27
31
  ('time', models.DateTimeField(default=datetime.datetime.now, verbose_name='Время СМЭВ запроса')),
28
- ('interaction_type', models.PositiveSmallIntegerField(choices=[(0, 'СМЭВ'), (1, 'Не СМЭВ')], default=0, verbose_name='Вид взаимодействия')),
29
- ('direction', models.SmallIntegerField(choices=[(1, 'Входящие запросы'), (0, 'Исходящие запросы')], verbose_name='Направление запроса')),
32
+ (
33
+ 'interaction_type',
34
+ models.PositiveSmallIntegerField(
35
+ choices=[(0, 'СМЭВ'), (1, 'Не СМЭВ')], default=0, verbose_name='Вид взаимодействия'
36
+ ),
37
+ ),
38
+ (
39
+ 'direction',
40
+ models.SmallIntegerField(
41
+ choices=[(1, 'Входящие запросы'), (0, 'Исходящие запросы')], verbose_name='Направление запроса'
42
+ ),
43
+ ),
30
44
  ],
31
45
  options={
32
46
  'verbose_name': 'Лог запросов СМЭВ',
@@ -40,7 +54,10 @@ class Migration(migrations.Migration):
40
54
  ('mnemonics', models.CharField(max_length=100, verbose_name='Мнемоника')),
41
55
  ('address', models.CharField(max_length=100, verbose_name='Адрес СМЭВ')),
42
56
  ('source', models.CharField(max_length=100, verbose_name='Источник взаимодействия')),
43
- ('entity', models.CharField(blank=True, max_length=255, null=True, verbose_name='Наименование юр.лица')),
57
+ (
58
+ 'entity',
59
+ models.CharField(blank=True, max_length=255, null=True, verbose_name='Наименование юр.лица'),
60
+ ),
44
61
  ],
45
62
  options={
46
63
  'verbose_name': 'Поставщик СМЭВ',
@@ -5,7 +5,6 @@ from django.db import (
5
5
 
6
6
 
7
7
  class Migration(migrations.Migration):
8
-
9
8
  dependencies = [
10
9
  ('ws_log', '0001_initial'),
11
10
  ]
@@ -5,7 +5,6 @@ from django.db import (
5
5
 
6
6
 
7
7
  class Migration(migrations.Migration):
8
-
9
8
  dependencies = [
10
9
  ('ws_log', '0002_auto_20160628_1334'),
11
10
  ]
@@ -20,17 +19,34 @@ class Migration(migrations.Migration):
20
19
  migrations.AddField(
21
20
  model_name='smevlog',
22
21
  name='consumer_type',
23
- field=models.PositiveSmallIntegerField(blank=True, choices=[(0, 'Юридическое лицо'), (1, 'Физическое лицо')], default=1, null=True, verbose_name='Потребитель сервиса (физ.лицо, юр.лицо)'),
22
+ field=models.PositiveSmallIntegerField(
23
+ blank=True,
24
+ choices=[(0, 'Юридическое лицо'), (1, 'Физическое лицо')],
25
+ default=1,
26
+ null=True,
27
+ verbose_name='Потребитель сервиса (физ.лицо, юр.лицо)',
28
+ ),
24
29
  ),
25
30
  migrations.AddField(
26
31
  model_name='smevlog',
27
32
  name='source',
28
- field=models.PositiveSmallIntegerField(blank=True, choices=[(0, 'ЕПГУ'), (1, 'РПГУ'), (2, 'Межведомственное взаимодействие')], default=None, null=True, verbose_name='Источник взаимодействия'),
33
+ field=models.PositiveSmallIntegerField(
34
+ blank=True,
35
+ choices=[(0, 'ЕПГУ'), (1, 'РПГУ'), (2, 'Межведомственное взаимодействие')],
36
+ default=None,
37
+ null=True,
38
+ verbose_name='Источник взаимодействия',
39
+ ),
29
40
  ),
30
41
  migrations.AddField(
31
42
  model_name='smevlog',
32
43
  name='target_name',
33
- field=models.CharField(blank=True, max_length=100, null=True, verbose_name='Наименование электронного сервиса Системы, к которому было обращение'),
44
+ field=models.CharField(
45
+ blank=True,
46
+ max_length=100,
47
+ null=True,
48
+ verbose_name='Наименование электронного сервиса Системы, к которому было обращение',
49
+ ),
34
50
  ),
35
51
  # Переименовывает поле error в result.
36
52
  migrations.RenameField('SmevLog', 'error', 'result'),
@@ -5,7 +5,6 @@ from django.db import (
5
5
 
6
6
 
7
7
  class Migration(migrations.Migration):
8
-
9
8
  dependencies = [
10
9
  ('ws_log', '0003_add_fields_to_smev_logs'),
11
10
  ]
@@ -15,15 +14,17 @@ class Migration(migrations.Migration):
15
14
  """ALTER TABLE ws_log_smevprovider ALTER COLUMN source
16
15
  TYPE smallint USING (source::smallint);""",
17
16
  reverse_sql=(
18
- """ALTER TABLE ws_log_smevprovider ALTER COLUMN source
19
- TYPE varchar(100) USING (source::varchar(100));""")
17
+ """ALTER TABLE ws_log_smevprovider ALTER COLUMN source
18
+ TYPE varchar(100) USING (source::varchar(100));"""
19
+ ),
20
20
  ),
21
21
  migrations.AlterField(
22
22
  model_name='smevprovider',
23
23
  name='source',
24
24
  field=models.PositiveSmallIntegerField(
25
- choices=[(0, 'ЕПГУ'), (1, 'РПГУ'),
26
- (2, 'Межведомственное взаимодействие')],
25
+ choices=[(0, 'ЕПГУ'), (1, 'РПГУ'), (2, 'Межведомственное взаимодействие')],
27
26
  default=0,
28
- verbose_name='Источник взаимодействия'), ),
27
+ verbose_name='Источник взаимодействия',
28
+ ),
29
+ ),
29
30
  ]
@@ -7,7 +7,6 @@ from django.db import (
7
7
 
8
8
 
9
9
  class Migration(migrations.Migration):
10
-
11
10
  dependencies = [
12
11
  ('ws_log', '0004_auto_20160727_1600'),
13
12
  ]
@@ -16,7 +15,13 @@ class Migration(migrations.Migration):
16
15
  migrations.AlterField(
17
16
  model_name='smevlog',
18
17
  name='consumer_type',
19
- field=models.PositiveSmallIntegerField(blank=True, choices=[(0, 'Юридическое лицо'), (1, 'Физическое лицо')], default=1, null=True, verbose_name='Потребитель сервиса'),
18
+ field=models.PositiveSmallIntegerField(
19
+ blank=True,
20
+ choices=[(0, 'Юридическое лицо'), (1, 'Физическое лицо')],
21
+ default=1,
22
+ null=True,
23
+ verbose_name='Потребитель сервиса',
24
+ ),
20
25
  ),
21
26
  migrations.AlterField(
22
27
  model_name='smevlog',
@@ -26,7 +31,9 @@ class Migration(migrations.Migration):
26
31
  migrations.AlterField(
27
32
  model_name='smevlog',
28
33
  name='target_name',
29
- field=models.CharField(blank=True, max_length=100, null=True, verbose_name='Наименование электронного сервиса'),
34
+ field=models.CharField(
35
+ blank=True, max_length=100, null=True, verbose_name='Наименование электронного сервиса'
36
+ ),
30
37
  ),
31
38
  migrations.AlterField(
32
39
  model_name='smevlog',
@@ -36,6 +43,9 @@ class Migration(migrations.Migration):
36
43
  migrations.AlterField(
37
44
  model_name='smevprovider',
38
45
  name='source',
39
- field=models.PositiveSmallIntegerField(choices=[(0, 'ЕПГУ'), (1, 'РПГУ'), (2, 'Межведомственное взаимодействие')], verbose_name='Источник взаимодействия'),
46
+ field=models.PositiveSmallIntegerField(
47
+ choices=[(0, 'ЕПГУ'), (1, 'РПГУ'), (2, 'Межведомственное взаимодействие')],
48
+ verbose_name='Источник взаимодействия',
49
+ ),
40
50
  ),
41
51
  ]
@@ -5,7 +5,6 @@ from django.db import (
5
5
 
6
6
 
7
7
  class Migration(migrations.Migration):
8
-
9
8
  dependencies = [
10
9
  ('ws_log', '0005_auto_20161130_1615'),
11
10
  ]
@@ -14,6 +13,8 @@ class Migration(migrations.Migration):
14
13
  migrations.AlterField(
15
14
  model_name='smevprovider',
16
15
  name='service_address_status_changes',
17
- field=models.CharField(blank=True, max_length=100, null=True, verbose_name='Адрес сервиса изменения статуса'),
16
+ field=models.CharField(
17
+ blank=True, max_length=100, null=True, verbose_name='Адрес сервиса изменения статуса'
18
+ ),
18
19
  ),
19
20
  ]
@@ -5,7 +5,6 @@ from django.db import (
5
5
 
6
6
 
7
7
  class Migration(migrations.Migration):
8
-
9
8
  dependencies = [
10
9
  ('ws_log', '0006_auto_20170327_1027'),
11
10
  ]
@@ -16,18 +15,18 @@ class Migration(migrations.Migration):
16
15
  name='source',
17
16
  field=models.PositiveSmallIntegerField(
18
17
  blank=True,
19
- choices=[(0, 'ЕПГУ'), (1, 'РПГУ'),
20
- (2, 'Межведомственное взаимодействие'),
21
- (3, 'Барс-Образование')],
18
+ choices=[(0, 'ЕПГУ'), (1, 'РПГУ'), (2, 'Межведомственное взаимодействие'), (3, 'Барс-Образование')],
22
19
  default=None,
23
20
  null=True,
24
- verbose_name='Источник взаимодействия'), ),
21
+ verbose_name='Источник взаимодействия',
22
+ ),
23
+ ),
25
24
  migrations.AlterField(
26
25
  model_name='smevprovider',
27
26
  name='source',
28
27
  field=models.PositiveSmallIntegerField(
29
- choices=[(0, 'ЕПГУ'), (1, 'РПГУ'),
30
- (2, 'Межведомственное взаимодействие'),
31
- (3, 'Концентратор')],
32
- verbose_name='Источник взаимодействия'), ),
28
+ choices=[(0, 'ЕПГУ'), (1, 'РПГУ'), (2, 'Межведомственное взаимодействие'), (3, 'Концентратор')],
29
+ verbose_name='Источник взаимодействия',
30
+ ),
31
+ ),
33
32
  ]
@@ -5,8 +5,9 @@ from django.db import (
5
5
 
6
6
 
7
7
  class Migration(migrations.Migration):
8
-
9
- dependencies = [('ws_log', '0007_auto_20180607_1040'), ]
8
+ dependencies = [
9
+ ('ws_log', '0007_auto_20180607_1040'),
10
+ ]
10
11
 
11
12
  operations = [
12
13
  migrations.AlterField(
@@ -17,17 +18,29 @@ class Migration(migrations.Migration):
17
18
  null=True,
18
19
  verbose_name='Источник взаимодействия',
19
20
  blank=True,
20
- choices=[(0, 'ЕПГУ'), (1, 'РПГУ'),
21
- (2, 'Межведомственное взаимодействие'),
22
- (3, 'Барс-Образование'), (4, 'Концентратор'),
23
- (5, 'МФЦ')]), ),
21
+ choices=[
22
+ (0, 'ЕПГУ'),
23
+ (1, 'РПГУ'),
24
+ (2, 'Межведомственное взаимодействие'),
25
+ (3, 'Барс-Образование'),
26
+ (4, 'Концентратор'),
27
+ (5, 'МФЦ'),
28
+ ],
29
+ ),
30
+ ),
24
31
  migrations.AlterField(
25
32
  model_name='smevprovider',
26
33
  name='source',
27
34
  field=models.PositiveSmallIntegerField(
28
35
  verbose_name='Источник взаимодействия',
29
- choices=[(0, 'ЕПГУ'), (1, 'РПГУ'),
30
- (2, 'Межведомственное взаимодействие'),
31
- (3, 'Барс-Образование'), (4, 'Концентратор'),
32
- (5, 'МФЦ')]), ),
36
+ choices=[
37
+ (0, 'ЕПГУ'),
38
+ (1, 'РПГУ'),
39
+ (2, 'Межведомственное взаимодействие'),
40
+ (3, 'Барс-Образование'),
41
+ (4, 'Концентратор'),
42
+ (5, 'МФЦ'),
43
+ ],
44
+ ),
45
+ ),
33
46
  ]
@@ -6,7 +6,6 @@ from django.db import (
6
6
 
7
7
 
8
8
  class Migration(migrations.Migration):
9
-
10
9
  dependencies = [
11
10
  ('ws_log', '0008_auto_20180713_1445'),
12
11
  ]
@@ -15,6 +14,12 @@ class Migration(migrations.Migration):
15
14
  migrations.AlterField(
16
15
  model_name='smevlog',
17
16
  name='method_name',
18
- field=models.CharField(blank=True, db_index=True, max_length=250, null=True, verbose_name='\u041a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430'),
17
+ field=models.CharField(
18
+ blank=True,
19
+ db_index=True,
20
+ max_length=250,
21
+ null=True,
22
+ verbose_name='\u041a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430',
23
+ ),
19
24
  ),
20
25
  ]