edu-rdm-integration 3.15.3__py3-none-any.whl → 3.15.4__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.
@@ -21,6 +21,14 @@ HASH_ALGORITHM = HashGostFunctionVersion.GOST12_512
21
21
 
22
22
  BATCH_SIZE = 5000
23
23
 
24
+ CHUNK_MAX_VALUE = 100000
25
+ """Максимальное значение для размера чанка при сборе данных РВД.
26
+ Ограничение 100000 предотвращает чрезмерное потребление памяти и блокировку БД
27
+ при обработке больших объемов данных в одном батче."""
28
+
29
+ SPLIT_BY_QUANTITY_MAX_VALUE = 366
30
+ """Максимальное значение для размера подпериода при временном разделении данных."""
31
+
24
32
  ACADEMIC_YEAR = {
25
33
  'start_day': 1,
26
34
  'start_month': 9,
@@ -2,6 +2,9 @@ from functools import (
2
2
  partial,
3
3
  )
4
4
 
5
+ from django.conf import (
6
+ settings,
7
+ )
5
8
  from django.db.models import (
6
9
  F,
7
10
  Func,
@@ -268,6 +271,4 @@ class BaseCollectingDataProgressPack(BaseCommandProgressPack):
268
271
  )
269
272
  for command in commands_to_save
270
273
  ]
271
-
272
- for obj in objs:
273
- super().save_row(obj, create_new, request, context, *args, **kwargs)
274
+ self.model.objects.bulk_create(objs, batch_size=settings.COLLECT_PROGRESS_BATCH_SIZE)
@@ -0,0 +1,77 @@
1
+ {% load educommon %}
2
+ {% include "ui-js/validators.js" %}
3
+
4
+ Ext.onReady(function() {
5
+ // Инициализация валидаторов
6
+ initializeValidators();
7
+
8
+ // Инициализация взаимозависимых полей
9
+ initializeBatchSizeSplitByLogic();
10
+ });
11
+
12
+ function initializeValidators() {
13
+ // Валидатор для institute_ids
14
+ var instituteIdsField = Ext.getCmp('institute_ids');
15
+ if (instituteIdsField) {
16
+ instituteIdsField.validate = instituteIdsValidator;
17
+ instituteIdsField.on('blur', function() {
18
+ this.validate();
19
+ });
20
+ }
21
+
22
+ // Валидатор для institute_count
23
+ var instituteCountField = Ext.getCmp('institute_count');
24
+ if (instituteCountField) {
25
+ var originalValidator = instituteCountField.validate;
26
+
27
+ instituteCountField.validate = function() {
28
+ if (!instituteCountValidator.call(this)) {
29
+ return false;
30
+ }
31
+ if (originalValidator) {
32
+ return originalValidator.call(this);
33
+ }
34
+ return true;
35
+ };
36
+
37
+ instituteCountField.on('blur', function() {
38
+ this.validate();
39
+ });
40
+ }
41
+ }
42
+
43
+ function initializeBatchSizeSplitByLogic() {
44
+ var batchSizeField = Ext.getCmp('batch_size');
45
+ var splitByField = Ext.getCmp('split_by');
46
+
47
+ if (!batchSizeField || !splitByField) {
48
+ return;
49
+ }
50
+
51
+ // Функция для обновления обязательности полей
52
+ function updateFieldRequirements() {
53
+ var batchSizeValue = batchSizeField.getValue();
54
+ var splitByValue = splitByField.getValue();
55
+
56
+ if (splitByValue && splitByValue !== '') {
57
+ batchSizeField.allowBlank = true;
58
+ batchSizeField.clearInvalid();
59
+ } else {
60
+ batchSizeField.allowBlank = false;
61
+ }
62
+
63
+ if (batchSizeValue && batchSizeValue !== '' && batchSizeValue !== 0) {
64
+ splitByField.allowBlank = true;
65
+ splitByField.clearInvalid();
66
+ } else {
67
+ splitByField.allowBlank = false;
68
+ }
69
+ }
70
+
71
+ // Обработчики изменения полей
72
+ batchSizeField.on('change', updateFieldRequirements);
73
+ splitByField.on('change', updateFieldRequirements);
74
+
75
+ // Инициализация при загрузке
76
+ updateFieldRequirements();
77
+ }
@@ -0,0 +1,51 @@
1
+ // Валидатор для поля institute_ids
2
+ var instituteIdsValidator = function () {
3
+ var value = this.getValue();
4
+
5
+ // Если поле пустое - это допустимо
6
+ if (!value || value.trim() === '') {
7
+ this.clearInvalid();
8
+ return true;
9
+ }
10
+
11
+ value = value.trim();
12
+
13
+ if (!/^[0-9,]+$/.test(value)) {
14
+ this.markInvalid('Разрешены только цифры и запятые');
15
+ return false;
16
+ }
17
+
18
+ var numbers = value.split(',');
19
+
20
+ for (var i = 0; i < numbers.length; i++) {
21
+ if (numbers[i].trim() === '') {
22
+ this.markInvalid('Между запятыми не должно быть пустых значений');
23
+ return false;
24
+ }
25
+ }
26
+
27
+ var uniqueNumbers = [];
28
+ for (var j = 0; j < numbers.length; j++) {
29
+ var num = parseInt(numbers[j].trim());
30
+ if (uniqueNumbers.indexOf(num) !== -1) {
31
+ this.markInvalid('ID организаций не должны повторяться');
32
+ return false;
33
+ }
34
+ uniqueNumbers.push(num);
35
+ }
36
+
37
+ this.clearInvalid();
38
+ return true;
39
+ };
40
+
41
+ // Валидатор для поля institute_count - запрещаем 0
42
+ var instituteCountValidator = function() {
43
+ var value = this.getValue();
44
+ if (value === 0) {
45
+ this.markInvalid('Количество организаций не может быть равно 0');
46
+ return false;
47
+ }
48
+
49
+ this.clearInvalid();
50
+ return true;
51
+ };
@@ -24,6 +24,8 @@ from educommon.utils.date import (
24
24
 
25
25
  from edu_rdm_integration.core.consts import (
26
26
  BATCH_SIZE,
27
+ CHUNK_MAX_VALUE,
28
+ SPLIT_BY_QUANTITY_MAX_VALUE,
27
29
  )
28
30
  from edu_rdm_integration.core.registry.ui import (
29
31
  BaseCreateCommandWindow,
@@ -75,8 +77,9 @@ class CreateCollectCommandWindow(BaseCreateCommandWindow):
75
77
  display_field='split_by',
76
78
  label='Единица подпериода',
77
79
  anchor='100%',
78
- editable=True,
80
+ editable=False,
79
81
  trigger_action_all=True,
82
+ client_id='split_by',
80
83
  )
81
84
  split_by.set_store(ExtDataStore(enumerate(DatesSplitter.get_split_by_modes())))
82
85
  split_by_quantity = ExtNumberField(
@@ -85,6 +88,7 @@ class CreateCollectCommandWindow(BaseCreateCommandWindow):
85
88
  allow_blank=False,
86
89
  allow_decimals=False,
87
90
  allow_negative=False,
91
+ max_value=SPLIT_BY_QUANTITY_MAX_VALUE,
88
92
  anchor='100%',
89
93
  value=1,
90
94
  )
@@ -109,6 +113,8 @@ class CreateCollectCommandWindow(BaseCreateCommandWindow):
109
113
  allow_negative=False,
110
114
  anchor='100%',
111
115
  value=BATCH_SIZE,
116
+ max_value=CHUNK_MAX_VALUE,
117
+ client_id='batch_size',
112
118
  )
113
119
  by_institutes = ExtCheckBox(
114
120
  anchor='100%',
@@ -116,10 +122,12 @@ class CreateCollectCommandWindow(BaseCreateCommandWindow):
116
122
  name='by_institutes',
117
123
  )
118
124
  institute_ids = ExtStringField(
119
- label='id организаций',
125
+ label='ID организаций (через запятую, например: 1,2,3 или оставить пустым для всех)',
120
126
  name='institute_ids',
121
127
  allow_blank=True,
122
128
  anchor='100%',
129
+ max_length=100,
130
+ client_id='institute_ids',
123
131
  )
124
132
  institute_count = ExtNumberField(
125
133
  name='institute_count',
@@ -128,6 +136,8 @@ class CreateCollectCommandWindow(BaseCreateCommandWindow):
128
136
  anchor='100%',
129
137
  min_value=ALL_UNITS_IN_COMMAND,
130
138
  value=ALL_UNITS_IN_COMMAND,
139
+ client_id='institute_count',
140
+ allow_blank=False,
131
141
  )
132
142
  hint_text = ExtDisplayField(
133
143
  value=(
@@ -156,6 +166,12 @@ class CreateCollectCommandWindow(BaseCreateCommandWindow):
156
166
  split_mode,
157
167
  )
158
168
 
169
+ def set_params(self, params: Dict[str, Any]) -> None:
170
+ """Устанавливает параметры окна."""
171
+ super().set_params(params)
172
+
173
+ self.template_globals = 'ui-js/collect-command-window.js'
174
+
159
175
 
160
176
  class DetailCollectCommandWindow(BaseEditWindow):
161
177
  """Окно просмотра команды сбора данных модели РВД."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: edu-rdm-integration
3
- Version: 3.15.3
3
+ Version: 3.15.4
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
@@ -9,7 +9,7 @@ edu_rdm_integration/collect_and_export_data/migrations/0002_auto_20250204_1413.p
9
9
  edu_rdm_integration/collect_and_export_data/migrations/0003_auto_20250704_0725.py,sha256=IcBTuQWp7D_mP1chCgTXUIJcm5nf2Scdt3ZJgjCgvgI,1108
10
10
  edu_rdm_integration/collect_and_export_data/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  edu_rdm_integration/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- edu_rdm_integration/core/consts.py,sha256=5pFDMWNGqKYqgqqUjb_QiUyWnjugHzmpl6beMJgWVEI,955
12
+ edu_rdm_integration/core/consts.py,sha256=4dklnQS7rtuYJu0Hh7oX1Z9dc72pbIWZl9gXMUvc4rI,1526
13
13
  edu_rdm_integration/core/enums.py,sha256=HHZxX2vIe-c4SY6BIWgOg-Tu-_LVJjltFZ1lI9YITLw,3824
14
14
  edu_rdm_integration/core/helpers.py,sha256=Fe2AyI8kHAfcnXAn2I_SyNraI5uAjNzHObUNtZtum-g,12183
15
15
  edu_rdm_integration/core/mapping.py,sha256=1B6TsC4Os9wiM8L8BChnCNv_iWqjeWu3bdDsqKVsId0,616
@@ -151,10 +151,12 @@ edu_rdm_integration/stages/collect_data/migrations/0003_auto_20250704_0810.py,sh
151
151
  edu_rdm_integration/stages/collect_data/migrations/0004_auto_20250704_0825.py,sha256=B6SUsxlhQvWoD8lFGNwaMUCFDzhPj91bsMdmAcSuEDg,1379
152
152
  edu_rdm_integration/stages/collect_data/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
153
153
  edu_rdm_integration/stages/collect_data/registry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
154
- edu_rdm_integration/stages/collect_data/registry/actions.py,sha256=5eT6nw4xYuJlfVrFxoqn0SF4PqSgHIbMc7rlx8dWypE,9769
154
+ edu_rdm_integration/stages/collect_data/registry/actions.py,sha256=mUMGv1FjzjY0G46gTgi_mfL0yUjuCJlA2wQutq3jmPo,9798
155
155
  edu_rdm_integration/stages/collect_data/registry/apps.py,sha256=K5f97YXKMmdM7m33qgQYvJjrA8_eGAJ4VWyuRjJ0gwQ,439
156
- edu_rdm_integration/stages/collect_data/registry/ui.py,sha256=5qG5M2sw1qvrt3g_2ZOoJJw9YKmrmk7Hlt_VEnWCRhY,7736
156
+ edu_rdm_integration/stages/collect_data/registry/ui.py,sha256=oOghmS49uCOEycOL3Wz-4-NUSy9mp7_pcwXf_VVz8rU,8427
157
+ edu_rdm_integration/stages/collect_data/registry/templates/ui-js/collect-command-window.js,sha256=IWG4CczBG9-Bi6X2Hivod4z63gSBZ6Fd126QVRRFacA,2386
157
158
  edu_rdm_integration/stages/collect_data/registry/templates/ui-js/create-collect-command-win.js,sha256=BypYLy6-xKjmQucGy_uVEx2830jh5f7VFvUaAaqL_AY,549
159
+ edu_rdm_integration/stages/collect_data/registry/templates/ui-js/validators.js,sha256=c0p0ND7i2C-fZrADgiUv9Eekjx_ZlFHBrgd-oXuqXKI,1525
158
160
  edu_rdm_integration/stages/export_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
159
161
  edu_rdm_integration/stages/export_data/apps.py,sha256=TU6AaMZGQE2oHVwKgtUDzFplaVasb2tMIurhkhwkxZo,406
160
162
  edu_rdm_integration/stages/export_data/consts.py,sha256=ZEi1kXMs-54KFKxkyGIQVwZ4d8OrOF_vLFQIjjWdSPQ,441
@@ -244,8 +246,8 @@ edu_rdm_integration/stages/upload_data/uploader_log/ui.py,sha256=mU3XA9zVKHGqzNk
244
246
  edu_rdm_integration/stages/upload_data/uploader_log/migrations/0001_initial.py,sha256=r5oOB7DBK9-mfuqPAgjXUJY5-hEcmMdILCwDTpaLnBc,753
245
247
  edu_rdm_integration/stages/upload_data/uploader_log/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
246
248
  edu_rdm_integration/stages/upload_data/uploader_log/templates/ui-js/object-grid-buttons.js,sha256=2xyGe0wdVokM0RhpzRzcRvJPBkBmPe3SlZry4oP4Nzs,6201
247
- edu_rdm_integration-3.15.3.dist-info/licenses/LICENSE,sha256=uw43Gjjj-1vXWCItfSrNDpbejnOwZMrNerUh8oWbq8Q,3458
248
- edu_rdm_integration-3.15.3.dist-info/METADATA,sha256=vkV8qNF7vynwb7_ZOPokDcEXK0htHfU1hkfxktyjsPA,39741
249
- edu_rdm_integration-3.15.3.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
250
- edu_rdm_integration-3.15.3.dist-info/top_level.txt,sha256=nRJV0O14UtNE-jGIYG03sohgFnZClvf57H5m6VBXe9Y,20
251
- edu_rdm_integration-3.15.3.dist-info/RECORD,,
249
+ edu_rdm_integration-3.15.4.dist-info/licenses/LICENSE,sha256=uw43Gjjj-1vXWCItfSrNDpbejnOwZMrNerUh8oWbq8Q,3458
250
+ edu_rdm_integration-3.15.4.dist-info/METADATA,sha256=hkEr7M93oXb0udY1lgc4_zF_YdGnuH9wEZStdA4xV00,39741
251
+ edu_rdm_integration-3.15.4.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
252
+ edu_rdm_integration-3.15.4.dist-info/top_level.txt,sha256=nRJV0O14UtNE-jGIYG03sohgFnZClvf57H5m6VBXe9Y,20
253
+ edu_rdm_integration-3.15.4.dist-info/RECORD,,