educommon 3.13.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 (220) 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 +4 -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.0.dist-info → educommon-3.13.2.dist-info}/METADATA +26 -14
  214. educommon-3.13.2.dist-info/RECORD +354 -0
  215. educommon/utils/patches.py +0 -27
  216. educommon/version.conf +0 -11
  217. educommon-3.13.0.dist-info/RECORD +0 -357
  218. educommon-3.13.0.dist-info/dependency_links.txt +0 -1
  219. {educommon-3.13.0.dist-info → educommon-3.13.2.dist-info}/WHEEL +0 -0
  220. {educommon-3.13.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
 
4
5
  from django.db import (
@@ -53,12 +54,9 @@ class ExtendedSmevLogManager(models.Manager):
53
54
  # Пустые и null значения приведем к значению по умолчанию "Успешно"
54
55
  # для использования в фильтрации
55
56
  result_with_default=Case(
56
- When(
57
- Q(result__isnull=True) | Q(result=''),
58
- then=Value(SmevLog.RESULT_DEFAULT_VALUE)
59
- ),
57
+ When(Q(result__isnull=True) | Q(result=''), then=Value(SmevLog.RESULT_DEFAULT_VALUE)),
60
58
  default='result',
61
- output_field=models.CharField()
59
+ output_field=models.CharField(),
62
60
  ),
63
61
  )
64
62
 
@@ -99,44 +97,35 @@ class SmevLog(BaseObjectModel):
99
97
 
100
98
  RESULT_DEFAULT_VALUE = 'Успешно'
101
99
 
102
- service_address = models.CharField(
103
- 'Адрес сервиса', max_length=250, null=True, blank=True)
100
+ service_address = models.CharField('Адрес сервиса', max_length=250, null=True, blank=True)
104
101
 
105
- method_name = models.CharField(
106
- 'Код метода', max_length=250, null=True, blank=True, db_index=True)
102
+ method_name = models.CharField('Код метода', max_length=250, null=True, blank=True, db_index=True)
107
103
 
108
- method_verbose_name = models.CharField(
109
- 'Наименование метода', max_length=250, null=True, blank=True)
104
+ method_verbose_name = models.CharField('Наименование метода', max_length=250, null=True, blank=True)
110
105
 
111
106
  request = models.TextField('SOAP запрос', null=True, blank=True)
112
107
  response = models.TextField('SOAP ответ', null=True, blank=True)
113
108
  result = models.TextField('Результат', null=True, blank=True)
114
109
 
115
- time = models.DateTimeField(
116
- 'Время СМЭВ запроса', default=datetime.datetime.now, db_index=True)
110
+ time = models.DateTimeField('Время СМЭВ запроса', default=datetime.datetime.now, db_index=True)
117
111
 
118
112
  interaction_type = models.PositiveSmallIntegerField(
119
- 'Вид взаимодействия', choices=INTERACTION_TYPES, default=IS_SMEV)
120
-
121
- direction = models.SmallIntegerField(
122
- choices=DIRECTION,
123
- verbose_name='Направление запроса'
113
+ 'Вид взаимодействия', choices=INTERACTION_TYPES, default=IS_SMEV
124
114
  )
125
115
 
116
+ direction = models.SmallIntegerField(choices=DIRECTION, verbose_name='Направление запроса')
117
+
126
118
  consumer_type = models.PositiveSmallIntegerField(
127
- 'Потребитель сервиса', choices=CONSUMER_TYPES, default=INDIVIDUAL,
128
- null=True, blank=True)
119
+ 'Потребитель сервиса', choices=CONSUMER_TYPES, default=INDIVIDUAL, null=True, blank=True
120
+ )
129
121
 
130
- consumer_name = models.CharField(
131
- 'Наименование потребителя', max_length=100, null=True, blank=True)
122
+ consumer_name = models.CharField('Наименование потребителя', max_length=100, null=True, blank=True)
132
123
 
133
124
  source = models.PositiveSmallIntegerField(
134
- 'Источник взаимодействия', choices=SOURCE_TYPES,
135
- default=None, null=True, blank=True)
125
+ 'Источник взаимодействия', choices=SOURCE_TYPES, default=None, null=True, blank=True
126
+ )
136
127
 
137
- target_name = models.CharField(
138
- 'Наименование электронного сервиса', max_length=100, null=True,
139
- blank=True)
128
+ target_name = models.CharField('Наименование электронного сервиса', max_length=100, null=True, blank=True)
140
129
 
141
130
  objects = models.Manager()
142
131
  extended_manager = ExtendedSmevLogManager()
@@ -158,15 +147,12 @@ class SmevProvider(BaseObjectModel):
158
147
 
159
148
  mnemonics = models.CharField('Мнемоника', max_length=100)
160
149
  address = models.CharField('Адрес СМЭВ', max_length=100)
161
- source = models.PositiveSmallIntegerField(
162
- 'Источник взаимодействия', choices=SOURCE_TYPES)
163
- service_name = models.CharField(
164
- 'Наименование эл. сервиса', max_length=100)
150
+ source = models.PositiveSmallIntegerField('Источник взаимодействия', choices=SOURCE_TYPES)
151
+ service_name = models.CharField('Наименование эл. сервиса', max_length=100)
165
152
  service_address_status_changes = models.CharField(
166
- 'Адрес сервиса изменения статуса', max_length=100,
167
- null=True, blank=True)
168
- entity = models.CharField(
169
- 'Наименование юр.лица', max_length=255, null=True, blank=True)
153
+ 'Адрес сервиса изменения статуса', max_length=100, null=True, blank=True
154
+ )
155
+ entity = models.CharField('Наименование юр.лица', max_length=255, null=True, blank=True)
170
156
 
171
157
  class Meta:
172
158
  verbose_name = 'Поставщик СМЭВ'
@@ -12,7 +12,8 @@ class SmevLogDataProvider(AbstractDataProvider):
12
12
  """Провайдер данных отчета "Логи СМЭВ"."""
13
13
 
14
14
  def init(self, **params):
15
- super(SmevLogDataProvider, self).init(**params)
15
+ super().init(**params)
16
+
16
17
  self.date_begin = params['date_begin']
17
18
  self.date_end = params['date_end']
18
19
 
@@ -26,7 +26,8 @@ class SmevLogReportBuilder(AbstractReportBuilder):
26
26
  """Билдер отчёта "Логи СМЭВ"."""
27
27
 
28
28
  def __init__(self, provider, adapter, report, *args, **kwargs):
29
- super(SmevLogReportBuilder, self).__init__(*args, **kwargs)
29
+ super().__init__(*args, **kwargs)
30
+
30
31
  self.provider = provider
31
32
  self.adapter = adapter
32
33
  self.report = report
@@ -37,23 +38,19 @@ class SmevLogReportBuilder(AbstractReportBuilder):
37
38
  self.header_section = self.report.get_section('header')
38
39
  self.row_section = self.report.get_section('row')
39
40
 
40
- self.header_section.flush(
41
- {'institute_name': self.params['institute_name']})
41
+ self.header_section.flush({'institute_name': self.params['institute_name']})
42
42
 
43
- smev_logs = self.provider.smev_logs_data.extra(
44
- select={'date': 'DATE(time)'}
45
- ).values(
43
+ smev_logs = self.provider.smev_logs_data.extra(select={'date': 'DATE(time)'}).values(
46
44
  'date', 'consumer_type', 'consumer_name', 'source', 'result'
47
45
  )
48
46
 
49
47
  sources = dict(SmevLog.SOURCE_TYPES)
50
48
  consumers = dict(SmevLog.CONSUMER_TYPES)
51
49
 
52
- for index, smev_log in enumerate(smev_logs, 1):
50
+ for index, smev_log in enumerate(smev_logs, 1):
53
51
  smev_log['index'] = index
54
52
  smev_log['source'] = sources.get(smev_log['source'], '')
55
- smev_log['consumer_type'] = consumers.get(
56
- smev_log['consumer_type'], '')
53
+ smev_log['consumer_type'] = consumers.get(smev_log['consumer_type'], '')
57
54
 
58
55
  if not smev_log['result']:
59
56
  smev_log['result'] = 'Успешно'
@@ -82,7 +79,7 @@ class SmevLogPrintReportPack(CommonReportPack):
82
79
  extend_menu = extend_desktop = None
83
80
 
84
81
  def declare_context(self, action):
85
- context = super(SmevLogPrintReportPack, self).declare_context(action)
82
+ context = super().declare_context(action)
86
83
 
87
84
  if action is self.report_action:
88
85
  context.update(
@@ -108,6 +105,4 @@ class SmevLogPrintReportPack(CommonReportPack):
108
105
  :raise: ApplicationLogicException
109
106
  """
110
107
  if context.date_begin > context.date_end:
111
- raise ApplicationLogicException(
112
- 'Дата по не может быть меньше чем Дата с!'
113
- )
108
+ raise ApplicationLogicException('Дата по не может быть меньше чем Дата с!')
@@ -1,4 +1,5 @@
1
1
  """Приложение для логирования запросов СМЭВ."""
2
+
2
3
  import sys
3
4
  import traceback
4
5
 
@@ -38,18 +39,12 @@ from educommon.ws_log.utils import (
38
39
  class LoggingDjangoApplication(DjangoApplication):
39
40
  """Переопределенный класс для логирования запросов СМЭВ."""
40
41
 
41
- def __init__(self, app, chunked=True, max_content_length=10 * 1024 * 1024,
42
- block_length=8 * 1024):
42
+ def __init__(self, app, chunked=True, max_content_length=10 * 1024 * 1024, block_length=8 * 1024):
43
43
  """Метод инициализации приложения для логирования запросов СМЭВ."""
44
- super(LoggingDjangoApplication, self).__init__(
45
- app, chunked, max_content_length, block_length)
46
- self.application_logger = logger_manager.get_application_logger(
47
- self.app.name
48
- )
49
- self.app.event_manager.add_listener(
50
- 'method_call',
51
- self.application_logger.collect_log_data
52
- )
44
+ super().__init__(app, chunked, max_content_length, block_length)
45
+
46
+ self.application_logger = logger_manager.get_application_logger(self.app.name)
47
+ self.app.event_manager.add_listener('method_call', self.application_logger.collect_log_data)
53
48
  self.event_manager.add_listener('wsgi_exception', wsgi_exception)
54
49
 
55
50
  def generate_contexts(self, ctx, in_string_charset=None):
@@ -63,8 +58,7 @@ class LoggingDjangoApplication(DjangoApplication):
63
58
 
64
59
  # sets ctx.in_body_doc, ctx.in_header_doc and
65
60
  # ctx.method_request_string
66
- self.app.in_protocol.decompose_incoming_envelope(
67
- ctx, ProtocolBase.REQUEST)
61
+ self.app.in_protocol.decompose_incoming_envelope(ctx, ProtocolBase.REQUEST)
68
62
 
69
63
  # returns a list of contexts. multiple contexts can be returned
70
64
  # when the requested method also has bound auxiliary methods.
@@ -96,11 +90,7 @@ class LoggingDjangoApplication(DjangoApplication):
96
90
  environ = self.application_logger.get_prepared_environ(request)
97
91
 
98
92
  try:
99
- response = WsgiApplication.__call__(
100
- self,
101
- environ,
102
- start_response
103
- )
93
+ response = WsgiApplication.__call__(self, environ, start_response)
104
94
  self.set_response(retval, response)
105
95
  except Exception:
106
96
  traceback_data = sys.exc_info()
@@ -112,7 +102,7 @@ class LoggingDjangoApplication(DjangoApplication):
112
102
  uri=request.build_absolute_uri(),
113
103
  retval=retval,
114
104
  traceback_data=traceback_data,
115
- environ=environ
105
+ environ=environ,
116
106
  )
117
107
 
118
108
  return retval
@@ -139,17 +129,12 @@ class LoggingService(ServiceBase):
139
129
  return result
140
130
 
141
131
  except SpyneException as exc:
142
- raise ApiError(
143
- exc.faultcode, exc.faultstring,
144
- ctx.function.__name__.replace('Request', 'Response'))
132
+ raise ApiError(exc.faultcode, exc.faultstring, ctx.function.__name__.replace('Request', 'Response'))
145
133
 
146
134
  except Exception as exc:
147
135
  log = ctx.transport.req['log_record']
148
- log.result = str(traceback.format_exc(), errors="ignore")
149
- raise ApiError(
150
- 'Server', exc.message,
151
- ctx.function.__name__.replace('Request', 'Response')
152
- )
136
+ log.result = str(traceback.format_exc(), errors='ignore')
137
+ raise ApiError('Server', str(exc), ctx.function.__name__.replace('Request', 'Response'))
153
138
 
154
139
  @rpc(Unicode, _returns=Unicode)
155
140
  def upper(self, s):
@@ -10,10 +10,9 @@ class SpyneException(Fault):
10
10
  It's a dot-delimited string whose first fragment is
11
11
  either 'Client' or 'Server'.
12
12
  """
13
+
13
14
  def __init__(self, code=0, message=''):
14
15
  if isinstance(code, str):
15
16
  Fault.__init__(self, faultstring=code)
16
17
  else:
17
- Fault.__init__(self,
18
- faultcode='Server;%d' % code,
19
- faultstring=message)
18
+ Fault.__init__(self, faultcode='Server;%d' % code, faultstring=message)
educommon/ws_log/ui.py CHANGED
@@ -1,4 +1,5 @@
1
1
  """Описания пользовательского интерфейса приложения логирования СМЭВ."""
2
+
2
3
  from m3_ext.ui import (
3
4
  all_components as ext,
4
5
  )
@@ -18,15 +19,13 @@ from educommon.ws_log.models import (
18
19
  )
19
20
 
20
21
 
21
- class SmevLogEditWindow(
22
- ModelEditWindow.fabricate(
23
- SmevLog, field_list=['request', 'response', 'result'])
24
- ):
22
+ class SmevLogEditWindow(ModelEditWindow.fabricate(SmevLog, field_list=['request', 'response', 'result'])):
25
23
  """Окно редактирования логов СМЭВ."""
26
24
 
27
25
  def set_params(self, params):
28
26
  """Настройка окна."""
29
- super(SmevLogEditWindow, self).set_params(params)
27
+ super().set_params(params)
28
+
30
29
  self.height, self.width = 800, 800
31
30
 
32
31
  self.make_read_only()
@@ -41,19 +40,21 @@ class SmevLogListWindow(BaseListWindow):
41
40
 
42
41
  def _init_components(self):
43
42
  """Создание компонентов окна."""
44
- super(SmevLogListWindow, self)._init_components()
45
- self.print_button = ext.ExtButton(
46
- text='Печать', handler='printSmevLogsReport', icon_cls='printer')
43
+ super()._init_components()
44
+
45
+ self.print_button = ext.ExtButton(text='Печать', handler='printSmevLogsReport', icon_cls='printer')
47
46
 
48
47
  def _do_layout(self):
49
48
  """Расположение компонентов окна."""
50
- super(SmevLogListWindow, self)._do_layout()
49
+ super()._do_layout()
50
+
51
51
  self.grid.top_bar.items.append(self.print_button)
52
52
  self.grid.top_bar.button_edit.icon_cls = Icons.APPLICATION_VIEW_DETAIL
53
53
 
54
54
  def set_params(self, params):
55
55
  """Настройка окна."""
56
- super(SmevLogListWindow, self).set_params(params)
56
+ super().set_params(params)
57
+
57
58
  self.maximized = True
58
59
  self.settings_report_window_url = params['settings_report_window_url']
59
60
  self.template_globals = 'ui-js/smev-logs-list-window.js'
@@ -63,7 +64,8 @@ class SmevProviderListWindow(BaseListWindow):
63
64
  """Окно списка поставщиков СМЭВ."""
64
65
 
65
66
  def set_params(self, params):
66
- super(SmevProviderListWindow, self).set_params(params)
67
+ super().set_params(params)
68
+
67
69
  self.width = 1000
68
70
 
69
71
 
@@ -73,27 +75,20 @@ class SmevProviderEditWindow(ModelEditWindow):
73
75
  model = SmevProvider
74
76
 
75
77
  def set_params(self, params):
76
- super(SmevProviderEditWindow, self).set_params(params)
78
+ super().set_params(params)
79
+
77
80
  self.form.label_width = 200
78
81
  self.width = 500
79
82
 
80
83
 
81
84
  class SmevLogReportWindow(BaseEditWindow):
82
-
83
85
  def _init_components(self):
84
86
  """Создание компонентов окна."""
85
- super(SmevLogReportWindow, self)._init_components()
86
- self.field_date_begin = ext.ExtDateField(
87
- name='date_begin',
88
- label='Дата с',
89
- allow_blank=False,
90
- anchor='100%')
87
+ super()._init_components()
91
88
 
92
- self.field_date_end = ext.ExtDateField(
93
- name='date_end',
94
- label='Дата по',
95
- allow_blank=False,
96
- anchor='100%')
89
+ self.field_date_begin = ext.ExtDateField(name='date_begin', label='Дата с', allow_blank=False, anchor='100%')
90
+
91
+ self.field_date_end = ext.ExtDateField(name='date_end', label='Дата по', allow_blank=False, anchor='100%')
97
92
 
98
93
  self.field_institute = ext.ExtDictSelectField(
99
94
  label='Организация',
@@ -102,20 +97,25 @@ class SmevLogReportWindow(BaseEditWindow):
102
97
  anchor='100%',
103
98
  hide_trigger=False,
104
99
  hide_edit_trigger=True,
105
- allow_blank=False)
100
+ allow_blank=False,
101
+ )
106
102
 
107
103
  def _do_layout(self):
108
104
  """Расположение компонентов окна."""
109
- super(SmevLogReportWindow, self)._do_layout()
110
- self.form.items.extend([
111
- self.field_institute,
112
- self.field_date_begin,
113
- self.field_date_end,
114
- ])
105
+ super()._do_layout()
106
+
107
+ self.form.items.extend(
108
+ [
109
+ self.field_institute,
110
+ self.field_date_begin,
111
+ self.field_date_end,
112
+ ]
113
+ )
115
114
 
116
115
  def set_params(self, params):
117
116
  """Настройка окна."""
118
- super(SmevLogReportWindow, self).set_params(params)
117
+ super().set_params(params)
118
+
119
119
  self.height, self.width = 200, 400
120
120
 
121
121
  self.field_institute.pack = params['institute_pack']
educommon/ws_log/utils.py CHANGED
@@ -14,9 +14,7 @@ class LoggerManager:
14
14
  """Класс для работы с логгерами приложений веб-сервисов."""
15
15
 
16
16
  def __init__(self):
17
- self._ws_loggers = dict(
18
- default=DefaultWsApplicationLogger()
19
- )
17
+ self._ws_loggers = dict(default=DefaultWsApplicationLogger())
20
18
 
21
19
  @staticmethod
22
20
  def __import_logger_class(logger_path):
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: educommon
3
- Version: 3.13.0
3
+ Version: 3.13.2
4
4
  Summary: Общая кодовая база для проектов БЦ Образование
5
- Home-page: https://stash.bars-open.ru/projects/EDUBASE/repos/educommon
6
- Author: BARS Group
7
- Author-email: education_dev@bars-open.ru
5
+ Author-email: BARS Group <education_dev@bars-open.ru>
6
+ Project-URL: Homepage, https://stash.bars-open.ru/projects/EDUBASE/repos/educommon/browse
7
+ Project-URL: Repository, https://stash.bars-open.ru/scm/edubase/educommon.git
8
8
  Classifier: Intended Audience :: Developers
9
9
  Classifier: Environment :: Web Environment
10
10
  Classifier: Natural Language :: Russian
@@ -17,7 +17,9 @@ Classifier: Framework :: Django :: 2.2
17
17
  Classifier: Framework :: Django :: 3.0
18
18
  Classifier: Framework :: Django :: 3.1
19
19
  Classifier: Framework :: Django :: 3.2
20
- Requires-Dist: packaging<24,>=21.3
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+ Requires-Dist: packaging<25,>=21
21
23
  Requires-Dist: Django<4,>=3.1
22
24
  Requires-Dist: django-mptt
23
25
  Requires-Dist: python-dateutil
@@ -27,7 +29,7 @@ Requires-Dist: requests
27
29
  Requires-Dist: celery
28
30
  Requires-Dist: spyne
29
31
  Requires-Dist: xlsxwriter<1,>=0.9.3
30
- Requires-Dist: m3-builder<2,>=1.2
32
+ Requires-Dist: python-magic==0.4.15
31
33
  Requires-Dist: m3-db-utils>=0.3.13
32
34
  Requires-Dist: m3-django-compat<2,>=1.10.2
33
35
  Requires-Dist: m3-core<3,>=2.2.16
@@ -35,11 +37,21 @@ Requires-Dist: m3-ui<3,>=2.2.40
35
37
  Requires-Dist: m3-objectpack<3,>=2.2.49
36
38
  Requires-Dist: m3-simple-report<2,>=1.4.1
37
39
  Requires-Dist: m3-spyne-smev<2,>=0.2.4
38
- Requires-Dist: python-magic==0.4.15
39
- Requires-Dist: distro<2,>=1.3.0
40
- Dynamic: author
41
- Dynamic: author-email
42
- Dynamic: classifier
43
- Dynamic: home-page
44
- Dynamic: requires-dist
45
- Dynamic: summary
40
+ Requires-Dist: distro<2,>=1.3.0; sys_platform == "linux"
41
+ Provides-Extra: dev
42
+ Requires-Dist: isort==5.12.0; extra == "dev"
43
+ Requires-Dist: ruff==0.11.2; extra == "dev"
44
+ Requires-Dist: flake8<7,>=4.0.1; extra == "dev"
45
+ Requires-Dist: pytest<8,>=3.2.5; extra == "dev"
46
+ Requires-Dist: pytest-cov<5; extra == "dev"
47
+ Provides-Extra: docs
48
+ Requires-Dist: sphinx<7.5,>=7; extra == "docs"
49
+ Requires-Dist: sphinx-autodoc-typehints<2.5,>=2; extra == "docs"
50
+ Requires-Dist: myst-parser<3.2,>=3; extra == "docs"
51
+ Requires-Dist: sphinx_design<0.7,>=0.6; extra == "docs"
52
+
53
+ # Общая кодовая база для проектов БЦ Образование
54
+
55
+ ## Запуск тестов
56
+ - Активировать окружение с установленными пакетами из ``requrements.txt``
57
+ - Выполнить скрипт ``tests/runtests.sh``.