edu-rdm-integration 3.11.3__py3-none-any.whl → 3.11.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.
Potentially problematic release.
This version of edu-rdm-integration might be problematic. Click here for more details.
- edu_rdm_integration/core/consts.py +8 -0
- edu_rdm_integration/stages/collect_data/registry/actions.py +4 -3
- edu_rdm_integration/stages/collect_data/registry/templates/ui-js/collect-command-window.js +77 -0
- edu_rdm_integration/stages/collect_data/registry/templates/ui-js/validators.js +51 -0
- edu_rdm_integration/stages/collect_data/registry/ui.py +18 -2
- {edu_rdm_integration-3.11.3.dist-info → edu_rdm_integration-3.11.4.dist-info}/METADATA +1 -1
- {edu_rdm_integration-3.11.3.dist-info → edu_rdm_integration-3.11.4.dist-info}/RECORD +10 -8
- {edu_rdm_integration-3.11.3.dist-info → edu_rdm_integration-3.11.4.dist-info}/WHEEL +0 -0
- {edu_rdm_integration-3.11.3.dist-info → edu_rdm_integration-3.11.4.dist-info}/licenses/LICENSE +0 -0
- {edu_rdm_integration-3.11.3.dist-info → edu_rdm_integration-3.11.4.dist-info}/top_level.txt +0 -0
|
@@ -16,6 +16,14 @@ HASH_ALGORITHM = 'md_gost12_512'
|
|
|
16
16
|
|
|
17
17
|
BATCH_SIZE = 5000
|
|
18
18
|
|
|
19
|
+
CHUNK_MAX_VALUE = 100000
|
|
20
|
+
"""Максимальное значение для размера чанка при сборе данных РВД.
|
|
21
|
+
Ограничение 100000 предотвращает чрезмерное потребление памяти и блокировку БД
|
|
22
|
+
при обработке больших объемов данных в одном батче."""
|
|
23
|
+
|
|
24
|
+
SPLIT_BY_QUANTITY_MAX_VALUE = 366
|
|
25
|
+
"""Максимальное значение для размера подпериода при временном разделении данных."""
|
|
26
|
+
|
|
19
27
|
ACADEMIC_YEAR = {
|
|
20
28
|
'start_day': 1,
|
|
21
29
|
'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,
|
|
@@ -70,8 +72,9 @@ class CreateCollectCommandWindow(BaseCreateCommandWindow):
|
|
|
70
72
|
display_field='split_by',
|
|
71
73
|
label='Единица подпериода',
|
|
72
74
|
anchor='100%',
|
|
73
|
-
editable=
|
|
75
|
+
editable=False,
|
|
74
76
|
trigger_action_all=True,
|
|
77
|
+
client_id='split_by',
|
|
75
78
|
)
|
|
76
79
|
split_by.set_store(ExtDataStore(enumerate(DatesSplitter.get_split_by_modes())))
|
|
77
80
|
split_by_quantity = ExtNumberField(
|
|
@@ -80,6 +83,7 @@ class CreateCollectCommandWindow(BaseCreateCommandWindow):
|
|
|
80
83
|
allow_blank=False,
|
|
81
84
|
allow_decimals=False,
|
|
82
85
|
allow_negative=False,
|
|
86
|
+
max_value=SPLIT_BY_QUANTITY_MAX_VALUE,
|
|
83
87
|
anchor='100%',
|
|
84
88
|
value=1,
|
|
85
89
|
)
|
|
@@ -104,6 +108,8 @@ class CreateCollectCommandWindow(BaseCreateCommandWindow):
|
|
|
104
108
|
allow_negative=False,
|
|
105
109
|
anchor='100%',
|
|
106
110
|
value=BATCH_SIZE,
|
|
111
|
+
max_value=CHUNK_MAX_VALUE,
|
|
112
|
+
client_id='batch_size',
|
|
107
113
|
)
|
|
108
114
|
by_institutes = ExtCheckBox(
|
|
109
115
|
anchor='100%',
|
|
@@ -111,10 +117,12 @@ class CreateCollectCommandWindow(BaseCreateCommandWindow):
|
|
|
111
117
|
name='by_institutes',
|
|
112
118
|
)
|
|
113
119
|
institute_ids = ExtStringField(
|
|
114
|
-
label='
|
|
120
|
+
label='ID организаций (через запятую, например: 1,2,3 или оставить пустым для всех)',
|
|
115
121
|
name='institute_ids',
|
|
116
122
|
allow_blank=True,
|
|
117
123
|
anchor='100%',
|
|
124
|
+
max_length=100,
|
|
125
|
+
client_id='institute_ids',
|
|
118
126
|
)
|
|
119
127
|
institute_count = ExtNumberField(
|
|
120
128
|
name='institute_count',
|
|
@@ -123,6 +131,8 @@ class CreateCollectCommandWindow(BaseCreateCommandWindow):
|
|
|
123
131
|
anchor='100%',
|
|
124
132
|
min_value=ALL_UNITS_IN_COMMAND,
|
|
125
133
|
value=ALL_UNITS_IN_COMMAND,
|
|
134
|
+
client_id='institute_count',
|
|
135
|
+
allow_blank=False,
|
|
126
136
|
)
|
|
127
137
|
hint_text = ExtDisplayField(
|
|
128
138
|
value=(
|
|
@@ -151,6 +161,12 @@ class CreateCollectCommandWindow(BaseCreateCommandWindow):
|
|
|
151
161
|
split_mode,
|
|
152
162
|
)
|
|
153
163
|
|
|
164
|
+
def set_params(self, params: Dict[str, Any]) -> None:
|
|
165
|
+
"""Устанавливает параметры окна."""
|
|
166
|
+
super().set_params(params)
|
|
167
|
+
|
|
168
|
+
self.template_globals = 'ui-js/collect-command-window.js'
|
|
169
|
+
|
|
154
170
|
|
|
155
171
|
class DetailCollectCommandWindow(BaseEditWindow):
|
|
156
172
|
"""Окно просмотра команды сбора данных модели РВД."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: edu-rdm-integration
|
|
3
|
-
Version: 3.11.
|
|
3
|
+
Version: 3.11.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
|
|
@@ -26,7 +26,7 @@ edu_rdm_integration/collect_and_export_data/migrations/0002_auto_20250204_1413.p
|
|
|
26
26
|
edu_rdm_integration/collect_and_export_data/migrations/0003_auto_20250704_0725.py,sha256=IcBTuQWp7D_mP1chCgTXUIJcm5nf2Scdt3ZJgjCgvgI,1108
|
|
27
27
|
edu_rdm_integration/collect_and_export_data/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
28
|
edu_rdm_integration/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
|
-
edu_rdm_integration/core/consts.py,sha256=
|
|
29
|
+
edu_rdm_integration/core/consts.py,sha256=NGqZaOcBqynb2ScgQSjqzTXj2tETyjFe69j0yh_6OEI,1438
|
|
30
30
|
edu_rdm_integration/core/enums.py,sha256=HHZxX2vIe-c4SY6BIWgOg-Tu-_LVJjltFZ1lI9YITLw,3824
|
|
31
31
|
edu_rdm_integration/core/helpers.py,sha256=Fe2AyI8kHAfcnXAn2I_SyNraI5uAjNzHObUNtZtum-g,12183
|
|
32
32
|
edu_rdm_integration/core/mapping.py,sha256=1B6TsC4Os9wiM8L8BChnCNv_iWqjeWu3bdDsqKVsId0,616
|
|
@@ -168,9 +168,11 @@ edu_rdm_integration/stages/collect_data/migrations/0003_auto_20250704_0810.py,sh
|
|
|
168
168
|
edu_rdm_integration/stages/collect_data/migrations/0004_auto_20250704_0825.py,sha256=B6SUsxlhQvWoD8lFGNwaMUCFDzhPj91bsMdmAcSuEDg,1379
|
|
169
169
|
edu_rdm_integration/stages/collect_data/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
170
170
|
edu_rdm_integration/stages/collect_data/registry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
171
|
-
edu_rdm_integration/stages/collect_data/registry/actions.py,sha256=
|
|
171
|
+
edu_rdm_integration/stages/collect_data/registry/actions.py,sha256=mUMGv1FjzjY0G46gTgi_mfL0yUjuCJlA2wQutq3jmPo,9798
|
|
172
172
|
edu_rdm_integration/stages/collect_data/registry/apps.py,sha256=K5f97YXKMmdM7m33qgQYvJjrA8_eGAJ4VWyuRjJ0gwQ,439
|
|
173
|
-
edu_rdm_integration/stages/collect_data/registry/ui.py,sha256=
|
|
173
|
+
edu_rdm_integration/stages/collect_data/registry/ui.py,sha256=XZ62jhLhNCMnlGeMuDzXarGvHAoYU6wm0xRPM-wGnV8,8304
|
|
174
|
+
edu_rdm_integration/stages/collect_data/registry/templates/ui-js/collect-command-window.js,sha256=IWG4CczBG9-Bi6X2Hivod4z63gSBZ6Fd126QVRRFacA,2386
|
|
175
|
+
edu_rdm_integration/stages/collect_data/registry/templates/ui-js/validators.js,sha256=c0p0ND7i2C-fZrADgiUv9Eekjx_ZlFHBrgd-oXuqXKI,1525
|
|
174
176
|
edu_rdm_integration/stages/export_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
175
177
|
edu_rdm_integration/stages/export_data/apps.py,sha256=TU6AaMZGQE2oHVwKgtUDzFplaVasb2tMIurhkhwkxZo,406
|
|
176
178
|
edu_rdm_integration/stages/export_data/consts.py,sha256=ZEi1kXMs-54KFKxkyGIQVwZ4d8OrOF_vLFQIjjWdSPQ,441
|
|
@@ -259,8 +261,8 @@ edu_rdm_integration/stages/upload_data/uploader_log/ui.py,sha256=mU3XA9zVKHGqzNk
|
|
|
259
261
|
edu_rdm_integration/stages/upload_data/uploader_log/migrations/0001_initial.py,sha256=r5oOB7DBK9-mfuqPAgjXUJY5-hEcmMdILCwDTpaLnBc,753
|
|
260
262
|
edu_rdm_integration/stages/upload_data/uploader_log/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
261
263
|
edu_rdm_integration/stages/upload_data/uploader_log/templates/ui-js/object-grid-buttons.js,sha256=2xyGe0wdVokM0RhpzRzcRvJPBkBmPe3SlZry4oP4Nzs,6201
|
|
262
|
-
edu_rdm_integration-3.11.
|
|
263
|
-
edu_rdm_integration-3.11.
|
|
264
|
-
edu_rdm_integration-3.11.
|
|
265
|
-
edu_rdm_integration-3.11.
|
|
266
|
-
edu_rdm_integration-3.11.
|
|
264
|
+
edu_rdm_integration-3.11.4.dist-info/licenses/LICENSE,sha256=uw43Gjjj-1vXWCItfSrNDpbejnOwZMrNerUh8oWbq8Q,3458
|
|
265
|
+
edu_rdm_integration-3.11.4.dist-info/METADATA,sha256=v72LoyQ5RTAQXa-d2ippCMt73SYuEv-Fr81Vsyd8e0Y,39698
|
|
266
|
+
edu_rdm_integration-3.11.4.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
|
267
|
+
edu_rdm_integration-3.11.4.dist-info/top_level.txt,sha256=nRJV0O14UtNE-jGIYG03sohgFnZClvf57H5m6VBXe9Y,20
|
|
268
|
+
edu_rdm_integration-3.11.4.dist-info/RECORD,,
|
|
File without changes
|
{edu_rdm_integration-3.11.3.dist-info → edu_rdm_integration-3.11.4.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|