edu-rdm-integration 3.8.0__py3-none-any.whl → 3.8.1__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.

Potentially problematic release.


This version of edu-rdm-integration might be problematic. Click here for more details.

@@ -9,6 +9,10 @@ from typing import (
9
9
  Optional,
10
10
  )
11
11
 
12
+ from edu_rdm_integration.uploader_log.enums import (
13
+ RequestResultStatus,
14
+ )
15
+
12
16
  from django.db.models import (
13
17
  CASCADE,
14
18
  PROTECT,
@@ -917,6 +921,13 @@ class UploaderClientLog(Entry):
917
921
  """Ошибка запроса."""
918
922
  return self.error
919
923
 
924
+ @property
925
+ def result_status_display(self) -> str:
926
+ """Результат запроса."""
927
+ result_status = getattr(self, 'result_status', RequestResultStatus.ERROR)
928
+
929
+ return RequestResultStatus.values.get(result_status) or RequestResultStatus.values[RequestResultStatus.ERROR]
930
+
920
931
  class Meta:
921
932
  proxy = True
922
933
 
@@ -11,6 +11,13 @@ from typing import (
11
11
  Optional,
12
12
  )
13
13
 
14
+ from django.conf import (
15
+ settings,
16
+ )
17
+ from edu_rdm_integration.uploader_log.enums import (
18
+ RequestResultStatus,
19
+ )
20
+
14
21
  from django.db.models import (
15
22
  Q,
16
23
  )
@@ -42,7 +49,9 @@ from edu_rdm_integration.models import (
42
49
  )
43
50
  from edu_rdm_integration.uploader_log.ui import (
44
51
  UploaderLogInfoWindow,
45
- UploaderLogListWindow,
52
+ )
53
+ from objectpack.filters import (
54
+ CustomFilter,
46
55
  )
47
56
 
48
57
 
@@ -54,7 +63,6 @@ class UploaderLogPack(ObjectPack):
54
63
  title = 'Журнал логов РВД'
55
64
  model = UploaderClientLog
56
65
 
57
- list_window = UploaderLogListWindow
58
66
  edit_window = UploaderLogInfoWindow
59
67
 
60
68
  _is_primary_for_model = False
@@ -108,8 +116,13 @@ class UploaderLogPack(ObjectPack):
108
116
  },
109
117
  {
110
118
  'header': 'Результат',
111
- 'data_index': 'http_response_status',
119
+ 'data_index': 'result_status_display',
112
120
  'sortable': False,
121
+ 'filter': ChoicesFilter(
122
+ choices=RequestResultStatus.get_choices(),
123
+ parser=int,
124
+ lookup='result_status',
125
+ ),
113
126
  'width': 5,
114
127
  },
115
128
  {
@@ -129,8 +142,13 @@ class UploaderLogPack(ObjectPack):
129
142
  {
130
143
  'header': 'Код статуса загрузки',
131
144
  'data_index': 'status_code',
132
- 'sortable': False,
145
+ 'sortable': True,
133
146
  'searchable': True,
147
+ 'filter': CustomFilter(
148
+ xtype='field',
149
+ parser=str,
150
+ lookup=lambda v: Q(response__icontains=f'"code": {v}'),
151
+ ),
134
152
  'width': 10,
135
153
  },
136
154
  {
@@ -151,7 +169,7 @@ class UploaderLogPack(ObjectPack):
151
169
  ),
152
170
  'column_renderer': boolean_column_renderer(),
153
171
  'width': 5,
154
- }
172
+ },
155
173
  ]
156
174
 
157
175
  def __init__(self):
@@ -204,6 +222,10 @@ class UploaderLogPack(ObjectPack):
204
222
  """Конфигурирование грида окна списка."""
205
223
  super().configure_grid(grid, *args, **kwargs)
206
224
 
225
+ if self.allow_paging:
226
+ grid.allow_paging = self.allow_paging
227
+ grid.paging_bar.page_size = self._DEFAULT_PAGING_LIMIT
228
+
207
229
  grid.url_edit = None
208
230
  add_one_row_button(
209
231
  'Просмотр',
@@ -224,11 +246,24 @@ class UploaderLogPack(ObjectPack):
224
246
 
225
247
  return params
226
248
 
227
- def extend_menu(self, menu): # noqa D102
228
- return menu.SubMenu(
229
- 'Администрирование', menu.SubMenu(
230
- 'Региональная витрина данных', menu.Item(
231
- self.title, self.list_window_action
232
- )
249
+ def extend_menu(self, menu):
250
+ """Размещение в меню подменю "Администрирование -> Региональная витрина данных -> Журнал логов РВД".
251
+
252
+ Args:
253
+ menu: Объект меню.
254
+ Returns:
255
+ Подменю "Администрирование -> Региональная витрина данных -> Журнал логов РВД".
256
+ """
257
+
258
+ if settings.RDM_MENU_ITEM:
259
+ return menu.SubMenu(
260
+ 'Администрирование',
261
+ menu.SubMenu(
262
+ 'Региональная витрина данных',
263
+ menu.Item(
264
+ self.title,
265
+ self.list_window_action,
266
+ ),
267
+ icon='menu-dicts-16',
268
+ ),
233
269
  )
234
- )
@@ -3,7 +3,6 @@ from m3_ext.ui.fields import (
3
3
  )
4
4
  from objectpack.ui import (
5
5
  BaseEditWindow,
6
- BaseListWindow,
7
6
  )
8
7
 
9
8
  from educommon.utils.ui import (
@@ -62,13 +61,3 @@ class UploaderLogInfoWindow(BaseEditWindow):
62
61
 
63
62
  switch_window_in_read_only_mode(self)
64
63
  self.make_read_only()
65
-
66
-
67
- class UploaderLogListWindow(BaseListWindow):
68
- """Окно для списка логов Загрузчика данных в витрину."""
69
-
70
- def _init_components(self):
71
- super()._init_components()
72
-
73
- self.grid.allow_paging = True
74
- self.grid.paging_bar.page_size = 35
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: edu-rdm-integration
3
- Version: 3.8.0
3
+ Version: 3.8.1
4
4
  Summary: Интеграция с Региональной витриной данных
5
5
  Author-email: BARS Group <education_dev@bars.group>
6
6
  Project-URL: Homepage, https://stash.bars-open.ru/projects/EDUBASE/repos/edu_rdm_integration/browse
@@ -8,7 +8,7 @@ edu_rdm_integration/entities.py,sha256=mhVeB88A-VD5IAzZCNeI1qnkvNoZ8LPiLBdqk1yA3
8
8
  edu_rdm_integration/enums.py,sha256=RpQIZM1iSgFbYDHfwrbT-BwgRf-N9ZZnJgx8UyRFQ2o,4978
9
9
  edu_rdm_integration/helpers.py,sha256=qwSyeIDBVEhdYG9raf3uLZPd1_2eXuNAaosSR7bLa50,14759
10
10
  edu_rdm_integration/mapping.py,sha256=1B6TsC4Os9wiM8L8BChnCNv_iWqjeWu3bdDsqKVsId0,616
11
- edu_rdm_integration/models.py,sha256=lrlJUAJJr29rrNwNdyCkswyRGmnm8XVDQDArWVO2ivc,31907
11
+ edu_rdm_integration/models.py,sha256=4IR5gdNX6YVvGysQQeixcjIOCrMQ37RVhmyvSwucLdc,32297
12
12
  edu_rdm_integration/redis_cache.py,sha256=SP_rcL5t6PTVLOnEYn_NTX0Z666VdZT4By2pyED24Z4,1537
13
13
  edu_rdm_integration/signals.py,sha256=3eRlpkDcFCF6TN80-QM8yBYLcyozzcmoPjz6r4_ApWg,73
14
14
  edu_rdm_integration/storages.py,sha256=G4Q4tIyJdEyb9ka551PADCFIm66bpsJe9VBRcvQhLMI,6745
@@ -176,14 +176,14 @@ edu_rdm_integration/registry/actions.py,sha256=-CHe95jbxO9JAEaOx6nV6Avn75ynppvZR
176
176
  edu_rdm_integration/registry/ui.py,sha256=v4GqbQUcoeHxfUPUYORuj4DfzIp49diY-F1hyL3TCPo,2592
177
177
  edu_rdm_integration/templates/ui-js/transferred-entity-list.js,sha256=IWEZ9JoTxD5-CLic5v07XHWW0iGRWk-cjeGVSzU4yKg,1117
178
178
  edu_rdm_integration/uploader_log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
179
- edu_rdm_integration/uploader_log/actions.py,sha256=2ckgI1PKgVcLYkbhtbK_bfv_6lDxpiIRSk1uPCIL-gg,6755
179
+ edu_rdm_integration/uploader_log/actions.py,sha256=K06pkaWGjPnt6cpPYdSk8X7nqQEfW-vXXvNVORRbDCs,7957
180
180
  edu_rdm_integration/uploader_log/apps.py,sha256=tYJj4-sDlq8fLOSvw18L_yys7SILpTKWNmE2Qug6GnE,265
181
181
  edu_rdm_integration/uploader_log/enums.py,sha256=rgSO3BL2rh2xpfm0Pt4waQW8fB1VMJLdsGmr3SXwH_U,266
182
182
  edu_rdm_integration/uploader_log/managers.py,sha256=OFdToWV8qhdfeGNpd-UWAmSEISzixmVQ6LF75EW7gzA,3248
183
- edu_rdm_integration/uploader_log/ui.py,sha256=YM9Buqp2wxE95Wf5gvAATBzuYzDOossK1sEmvFk07cI,2110
183
+ edu_rdm_integration/uploader_log/ui.py,sha256=7O63XJJYnJBLVU9aGuSyMOxFYtcj_Kyf5u6HIiuxl9A,1788
184
184
  edu_rdm_integration/uploader_log/templates/ui-js/object-grid-buttons.js,sha256=2xyGe0wdVokM0RhpzRzcRvJPBkBmPe3SlZry4oP4Nzs,6201
185
- edu_rdm_integration-3.8.0.dist-info/licenses/LICENSE,sha256=uw43Gjjj-1vXWCItfSrNDpbejnOwZMrNerUh8oWbq8Q,3458
186
- edu_rdm_integration-3.8.0.dist-info/METADATA,sha256=RG6vIjFCjWp4m7xz-Eey7SLDFCFRIhi3AX6D24dHRcQ,35263
187
- edu_rdm_integration-3.8.0.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
188
- edu_rdm_integration-3.8.0.dist-info/top_level.txt,sha256=nRJV0O14UtNE-jGIYG03sohgFnZClvf57H5m6VBXe9Y,20
189
- edu_rdm_integration-3.8.0.dist-info/RECORD,,
185
+ edu_rdm_integration-3.8.1.dist-info/licenses/LICENSE,sha256=uw43Gjjj-1vXWCItfSrNDpbejnOwZMrNerUh8oWbq8Q,3458
186
+ edu_rdm_integration-3.8.1.dist-info/METADATA,sha256=dEub92knjtp-P5cvuOvD1Fvfx9ZDv_Uwg7eR6JSW6_c,35263
187
+ edu_rdm_integration-3.8.1.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
188
+ edu_rdm_integration-3.8.1.dist-info/top_level.txt,sha256=nRJV0O14UtNE-jGIYG03sohgFnZClvf57H5m6VBXe9Y,20
189
+ edu_rdm_integration-3.8.1.dist-info/RECORD,,