educommon 3.12.0__py3-none-any.whl → 3.13.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- educommon/__init__.py +0 -1
- educommon/about/ui/actions.py +16 -30
- educommon/about/ui/ui.py +3 -12
- educommon/about/utils.py +6 -5
- educommon/async_task/__init__.py +0 -1
- educommon/async_task/actions.py +18 -13
- educommon/async_task/apps.py +4 -0
- educommon/async_task/locker.py +2 -5
- educommon/async_task/migrations/0001_initial.py +55 -9
- educommon/async_task/migrations/0002_task_type_and_status_data.py +94 -89
- educommon/async_task/migrations/0003_alter_runningtask_options.py +0 -1
- educommon/async_task/models.py +9 -6
- educommon/async_task/tasks.py +11 -7
- educommon/async_task/ui.py +16 -35
- educommon/async_tasks/__init__.py +0 -1
- educommon/async_tasks/apps.py +4 -0
- educommon/async_tasks/locks.py +11 -21
- educommon/async_tasks/migrations/0001_initial.py +68 -8
- educommon/async_tasks/migrations/0002_load_initial_data.py +0 -1
- educommon/async_tasks/models.py +9 -29
- educommon/async_tasks/tasks.py +25 -54
- educommon/audit_log/__init__.py +1 -0
- educommon/audit_log/actions.py +27 -36
- educommon/audit_log/app_meta.py +7 -4
- educommon/audit_log/apps.py +44 -29
- educommon/audit_log/constants.py +7 -4
- educommon/audit_log/error_log/actions.py +1 -3
- educommon/audit_log/helpers.py +2 -4
- educommon/audit_log/management/commands/reinstall_audit_log.py +11 -7
- educommon/audit_log/migrations/0001_initial.py +91 -16
- educommon/audit_log/migrations/0002_install_audit_log.py +13 -13
- educommon/audit_log/migrations/0003_logproxy.py +1 -3
- educommon/audit_log/migrations/0004_reinstall_audit_log.py +1 -4
- educommon/audit_log/migrations/0005_postgresql_error.py +4 -2
- educommon/audit_log/migrations/0006_auto_20200806_1707.py +3 -4
- educommon/audit_log/migrations/0007_create_selective_tables_function.py +8 -5
- educommon/audit_log/migrations/0008_table_logged.py +0 -1
- educommon/audit_log/migrations/0009_reinstall_audit_log.py +0 -1
- educommon/audit_log/models.py +36 -42
- educommon/audit_log/permissions.py +11 -9
- educommon/audit_log/proxies.py +12 -23
- educommon/audit_log/ui.py +18 -15
- educommon/audit_log/utils/__init__.py +28 -60
- educommon/audit_log/utils/operations.py +16 -2
- educommon/auth/__init__.py +0 -3
- educommon/auth/rbac/__init__.py +2 -4
- educommon/auth/rbac/actions.py +148 -145
- educommon/auth/rbac/app_meta.py +9 -6
- educommon/auth/rbac/backends/base.py +2 -8
- educommon/auth/rbac/backends/caching.py +27 -37
- educommon/auth/rbac/backends/simple.py +1 -4
- educommon/auth/rbac/checker.py +1 -3
- educommon/auth/rbac/management/commands/rbac.py +6 -11
- educommon/auth/rbac/manager.py +18 -47
- educommon/auth/rbac/migrations/0001_initial.py +73 -12
- educommon/auth/rbac/migrations/0002_model_modifier_metaclass_fix.py +7 -6
- educommon/auth/rbac/migrations/0003_permission_hidden.py +1 -5
- educommon/auth/rbac/migrations/0004_auto_20171024_1245.py +26 -19
- educommon/auth/rbac/models.py +63 -68
- educommon/auth/rbac/permissions.py +6 -7
- educommon/auth/rbac/ui.py +83 -84
- educommon/auth/rbac/utils.py +10 -11
- educommon/auth/rbac/validators.py +4 -5
- educommon/auth/simple_auth/__init__.py +1 -5
- educommon/auth/simple_auth/actions.py +79 -92
- educommon/auth/simple_auth/app_meta.py +2 -9
- educommon/auth/simple_auth/checkers.py +3 -3
- educommon/auth/simple_auth/migrations/0001_initial.py +23 -4
- educommon/auth/simple_auth/validators.py +0 -1
- educommon/contingent/actions.py +7 -7
- educommon/contingent/app_meta.py +1 -4
- educommon/contingent/base.py +10 -15
- educommon/contingent/catalogs.py +424 -540
- educommon/contingent/contingent_plugin/actions.py +4 -15
- educommon/contingent/contingent_plugin/apps.py +10 -4
- educommon/contingent/contingent_plugin/migrations/0001_initial.py +5 -6
- educommon/contingent/contingent_plugin/migrations/0002_add_contingent_model_deleted.py +6 -11
- educommon/contingent/contingent_plugin/model_views.py +2 -12
- educommon/contingent/contingent_plugin/models.py +2 -7
- educommon/contingent/contingent_plugin/observer.py +14 -13
- educommon/contingent/contingent_plugin/plugin_meta.py +1 -3
- educommon/contingent/contingent_plugin/storage.py +8 -7
- educommon/contingent/contingent_plugin/utils.py +6 -6
- educommon/django/db/fields.py +72 -86
- educommon/django/db/migration/__init__.py +3 -7
- educommon/django/db/migration/operations.py +29 -51
- educommon/django/db/mixins/__init__.py +16 -10
- educommon/django/db/mixins/date_interval.py +47 -75
- educommon/django/db/mixins/validation.py +26 -26
- educommon/django/db/model_view/__init__.py +18 -22
- educommon/django/db/models.py +9 -8
- educommon/django/db/observer.py +9 -27
- educommon/django/db/partitioning/__init__.py +66 -92
- educommon/django/db/partitioning/management/commands/apply_partitioning.py +3 -13
- educommon/django/db/partitioning/management/commands/clear_table.py +18 -14
- educommon/django/db/partitioning/management/commands/split_table.py +18 -13
- educommon/django/db/routers.py +6 -15
- educommon/django/db/signals.py +149 -2
- educommon/django/db/utils.py +14 -19
- educommon/django/db/validators/__init__.py +1 -0
- educommon/django/db/validators/simple.py +72 -100
- educommon/django/storages/atcfs/api.py +39 -53
- educommon/django/storages/atcfs/app_meta.py +1 -1
- educommon/django/storages/atcfs/management/commands/atcfs_migrate.py +42 -55
- educommon/django/storages/atcfs/models.py +0 -3
- educommon/django/storages/atcfs/monkey_patching.py +18 -12
- educommon/django/storages/atcfs/storage.py +14 -23
- educommon/extjs/fields/input_params.py +15 -45
- educommon/importer/XLSReader.py +143 -241
- educommon/importer/__init__.py +86 -4
- educommon/importer/api.py +53 -84
- educommon/importer/constants.py +4 -14
- educommon/importer/loggers.py +16 -26
- educommon/importer/proxy.py +131 -176
- educommon/importer/proxy_import.py +11 -12
- educommon/importer/report.py +4 -6
- educommon/importer/ui.py +32 -26
- educommon/importer/validators.py +4 -7
- educommon/integration_entities/helpers.py +14 -18
- educommon/ioc/__init__.py +3 -6
- educommon/logger/loggers.py +10 -14
- educommon/m3/__init__.py +20 -38
- educommon/m3/extensions/__init__.py +1 -0
- educommon/m3/extensions/listeners/__init__.py +22 -38
- educommon/m3/extensions/listeners/delete_check/listeners.py +31 -41
- educommon/m3/extensions/listeners/delete_check/mixins.py +20 -25
- educommon/m3/extensions/listeners/delete_check/signals.py +2 -2
- educommon/m3/extensions/listeners/delete_check/ui.py +15 -14
- educommon/m3/extensions/listeners/delete_check/utils.py +9 -11
- educommon/m3/extensions/ui.py +15 -33
- educommon/m3/transaction_context.py +17 -19
- educommon/objectpack/actions.py +70 -88
- educommon/objectpack/apps.py +5 -0
- educommon/objectpack/filters.py +9 -15
- educommon/objectpack/ui.py +59 -77
- educommon/report/__init__.py +9 -5
- educommon/report/actions.py +29 -32
- educommon/report/constructor/__init__.py +5 -8
- educommon/report/constructor/app_meta.py +1 -3
- educommon/report/constructor/apps.py +1 -0
- educommon/report/constructor/base.py +33 -80
- educommon/report/constructor/builders/excel/_base.py +138 -286
- educommon/report/constructor/builders/excel/_header.py +2 -9
- educommon/report/constructor/builders/excel/product.py +13 -34
- educommon/report/constructor/builders/excel/with_merged_cells.py +18 -14
- educommon/report/constructor/config.py +2 -0
- educommon/report/constructor/editor/actions.py +101 -215
- educommon/report/constructor/editor/ui.py +71 -93
- educommon/report/constructor/exceptions.py +6 -12
- educommon/report/constructor/migrations/0001_initial.py +36 -44
- educommon/report/constructor/migrations/0002_report_filters.py +86 -72
- educommon/report/constructor/migrations/0003_reportfilter_exclude.py +5 -5
- educommon/report/constructor/migrations/0004_reportfilter_fields.py +22 -18
- educommon/report/constructor/migrations/0005_reportcolumn_visible.py +5 -4
- educommon/report/constructor/migrations/0006_reportsorting.py +21 -17
- educommon/report/constructor/migrations/0007_include_available_units.py +14 -14
- educommon/report/constructor/migrations/0008_auto_20170407_1318.py +4 -5
- educommon/report/constructor/migrations/0009_auto_20180405_0642.py +1 -4
- educommon/report/constructor/migrations/0010_add_aggregate_fields.py +7 -8
- educommon/report/constructor/mixins.py +14 -15
- educommon/report/constructor/models.py +76 -124
- educommon/report/constructor/utils.py +3 -8
- educommon/report/constructor/validators.py +1 -3
- educommon/report/reporter.py +25 -43
- educommon/report/utils.py +14 -40
- educommon/rest/actions.py +7 -11
- educommon/rest/context.py +6 -16
- educommon/rest/controllers.py +10 -10
- educommon/rest/mixins.py +29 -27
- educommon/secure_media/app_meta.py +9 -9
- educommon/utils/__init__.py +3 -2
- educommon/utils/caching.py +1 -3
- educommon/utils/conversion.py +1 -3
- educommon/utils/crypto.py +1 -2
- educommon/utils/date.py +13 -26
- educommon/utils/db/__init__.py +17 -26
- educommon/utils/db/postgresql.py +1 -4
- educommon/utils/fonts/__init__.py +3 -4
- educommon/utils/licence/__init__.py +5 -16
- educommon/utils/misc.py +9 -18
- educommon/utils/object_grid.py +55 -62
- educommon/utils/phone_number/modelfields.py +1 -3
- educommon/utils/phone_number/phone_number.py +5 -8
- educommon/utils/phone_number/validators.py +8 -23
- educommon/utils/plugins.py +15 -28
- educommon/utils/registry.py +2 -1
- educommon/utils/seqtools.py +1 -3
- educommon/utils/serializer.py +9 -16
- educommon/utils/storage.py +3 -2
- educommon/utils/system.py +1 -3
- educommon/utils/system_app/management/commands/delete_objects.py +17 -34
- educommon/utils/ui.py +87 -84
- educommon/utils/xml/__init__.py +2 -7
- educommon/utils/xml/resolver.py +1 -0
- educommon/ws_log/actions.py +31 -76
- educommon/ws_log/base.py +6 -20
- educommon/ws_log/migrations/0001_initial.py +25 -8
- educommon/ws_log/migrations/0002_auto_20160628_1334.py +0 -1
- educommon/ws_log/migrations/0003_add_fields_to_smev_logs.py +20 -4
- educommon/ws_log/migrations/0004_auto_20160727_1600.py +7 -6
- educommon/ws_log/migrations/0005_auto_20161130_1615.py +14 -4
- educommon/ws_log/migrations/0006_auto_20170327_1027.py +3 -2
- educommon/ws_log/migrations/0007_auto_20180607_1040.py +8 -9
- educommon/ws_log/migrations/0008_auto_20180713_1445.py +23 -10
- educommon/ws_log/migrations/0009_auto_20201130_1553.py +7 -2
- educommon/ws_log/models.py +21 -35
- educommon/ws_log/provider.py +2 -1
- educommon/ws_log/report.py +8 -13
- educommon/ws_log/smev/applications.py +12 -27
- educommon/ws_log/smev/exceptions.py +2 -3
- educommon/ws_log/ui.py +32 -32
- educommon/ws_log/utils.py +1 -3
- educommon-3.13.2.dist-info/METADATA +57 -0
- educommon-3.13.2.dist-info/RECORD +354 -0
- {educommon-3.12.0.dist-info → educommon-3.13.2.dist-info}/WHEEL +1 -1
- educommon/utils/patches.py +0 -27
- educommon/version.conf +0 -11
- educommon-3.12.0.dist-info/METADATA +0 -47
- educommon-3.12.0.dist-info/RECORD +0 -357
- educommon-3.12.0.dist-info/dependency_links.txt +0 -1
- {educommon-3.12.0.dist-info → educommon-3.13.2.dist-info}/top_level.txt +0 -0
educommon/ws_log/models.py
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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 = 'Поставщик СМЭВ'
|
educommon/ws_log/provider.py
CHANGED
@@ -12,7 +12,8 @@ class SmevLogDataProvider(AbstractDataProvider):
|
|
12
12
|
"""Провайдер данных отчета "Логи СМЭВ"."""
|
13
13
|
|
14
14
|
def init(self, **params):
|
15
|
-
super(
|
15
|
+
super().init(**params)
|
16
|
+
|
16
17
|
self.date_begin = params['date_begin']
|
17
18
|
self.date_end = params['date_end']
|
18
19
|
|
educommon/ws_log/report.py
CHANGED
@@ -26,7 +26,8 @@ class SmevLogReportBuilder(AbstractReportBuilder):
|
|
26
26
|
"""Билдер отчёта "Логи СМЭВ"."""
|
27
27
|
|
28
28
|
def __init__(self, provider, adapter, report, *args, **kwargs):
|
29
|
-
super(
|
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,
|
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(
|
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(
|
45
|
-
|
46
|
-
self.application_logger = logger_manager.get_application_logger(
|
47
|
-
|
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=
|
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(
|
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(
|
45
|
-
|
46
|
-
|
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(
|
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(
|
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(
|
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(
|
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(
|
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.
|
93
|
-
|
94
|
-
|
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(
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
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(
|
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):
|
@@ -0,0 +1,57 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: educommon
|
3
|
+
Version: 3.13.2
|
4
|
+
Summary: Общая кодовая база для проектов БЦ Образование
|
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
|
+
Classifier: Intended Audience :: Developers
|
9
|
+
Classifier: Environment :: Web Environment
|
10
|
+
Classifier: Natural Language :: Russian
|
11
|
+
Classifier: Natural Language :: English
|
12
|
+
Classifier: Operating System :: OS Independent
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
14
|
+
Classifier: Programming Language :: Python
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
16
|
+
Classifier: Framework :: Django :: 2.2
|
17
|
+
Classifier: Framework :: Django :: 3.0
|
18
|
+
Classifier: Framework :: Django :: 3.1
|
19
|
+
Classifier: Framework :: Django :: 3.2
|
20
|
+
Requires-Python: >=3.9
|
21
|
+
Description-Content-Type: text/markdown
|
22
|
+
Requires-Dist: packaging<25,>=21
|
23
|
+
Requires-Dist: Django<4,>=3.1
|
24
|
+
Requires-Dist: django-mptt
|
25
|
+
Requires-Dist: python-dateutil
|
26
|
+
Requires-Dist: termcolor
|
27
|
+
Requires-Dist: django-sendfile
|
28
|
+
Requires-Dist: requests
|
29
|
+
Requires-Dist: celery
|
30
|
+
Requires-Dist: spyne
|
31
|
+
Requires-Dist: xlsxwriter<1,>=0.9.3
|
32
|
+
Requires-Dist: python-magic==0.4.15
|
33
|
+
Requires-Dist: m3-db-utils>=0.3.13
|
34
|
+
Requires-Dist: m3-django-compat<2,>=1.10.2
|
35
|
+
Requires-Dist: m3-core<3,>=2.2.16
|
36
|
+
Requires-Dist: m3-ui<3,>=2.2.40
|
37
|
+
Requires-Dist: m3-objectpack<3,>=2.2.49
|
38
|
+
Requires-Dist: m3-simple-report<2,>=1.4.1
|
39
|
+
Requires-Dist: m3-spyne-smev<2,>=0.2.4
|
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``.
|