edu-rdm-integration 3.18.4__py3-none-any.whl → 3.19.0__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/pipelines/cleanup_outdated_data/management/commands/rdm_cleanup_outdated_data.py +13 -3
- edu_rdm_integration/stages/export_data/registry/actions.py +10 -0
- {edu_rdm_integration-3.18.4.dist-info → edu_rdm_integration-3.19.0.dist-info}/METADATA +11 -1
- {edu_rdm_integration-3.18.4.dist-info → edu_rdm_integration-3.19.0.dist-info}/RECORD +7 -7
- {edu_rdm_integration-3.18.4.dist-info → edu_rdm_integration-3.19.0.dist-info}/WHEEL +0 -0
- {edu_rdm_integration-3.18.4.dist-info → edu_rdm_integration-3.19.0.dist-info}/licenses/LICENSE +0 -0
- {edu_rdm_integration-3.18.4.dist-info → edu_rdm_integration-3.19.0.dist-info}/top_level.txt +0 -0
edu_rdm_integration/pipelines/cleanup_outdated_data/management/commands/rdm_cleanup_outdated_data.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
from django.conf import (
|
|
2
|
+
settings,
|
|
3
|
+
)
|
|
1
4
|
from django.core.management import (
|
|
2
5
|
BaseCommand,
|
|
3
6
|
)
|
|
@@ -50,9 +53,16 @@ class Command(BaseCommand):
|
|
|
50
53
|
help='Включить логирование SQL-запросов, выполняемых во время работы команды.',
|
|
51
54
|
)
|
|
52
55
|
|
|
53
|
-
def
|
|
54
|
-
"""
|
|
56
|
+
def _cleanup_model_outdated_data(self, options):
|
|
57
|
+
"""Очистка устаревших данных моделей РВД."""
|
|
55
58
|
model_data_cleaner_manager = ModelOutdatedDataCleanerManager(
|
|
56
|
-
models=options['models'],
|
|
59
|
+
models=options['models'],
|
|
60
|
+
safe=options['safe'],
|
|
61
|
+
log_sql=options['log_sql'],
|
|
57
62
|
)
|
|
58
63
|
model_data_cleaner_manager.run()
|
|
64
|
+
|
|
65
|
+
def handle(self, *args, **options):
|
|
66
|
+
"""Запуск очистки устаревших данных РВД."""
|
|
67
|
+
if settings.RDM_ENABLE_CLEANUP_MODELS_OUTDATED_DATA:
|
|
68
|
+
self._cleanup_model_outdated_data(options)
|
|
@@ -13,6 +13,9 @@ from django.db.models import (
|
|
|
13
13
|
from django.db.transaction import (
|
|
14
14
|
atomic,
|
|
15
15
|
)
|
|
16
|
+
from m3.actions.exceptions import (
|
|
17
|
+
ApplicationLogicException,
|
|
18
|
+
)
|
|
16
19
|
from m3.actions.results import (
|
|
17
20
|
OperationResult,
|
|
18
21
|
)
|
|
@@ -258,6 +261,13 @@ class BaseExportingDataProgressPack(BaseCommandProgressPack):
|
|
|
258
261
|
batch_size=context.batch_size,
|
|
259
262
|
).generate()
|
|
260
263
|
|
|
264
|
+
if not commands:
|
|
265
|
+
raise ApplicationLogicException(
|
|
266
|
+
f'Недостаточно данных для выгрузки по модели "{obj.entity_id}" '
|
|
267
|
+
f'в указанный период с {context.period_started_at} по {context.period_ended_at}. '
|
|
268
|
+
f'Проверьте наличие данных в указанном временном диапазоне.'
|
|
269
|
+
)
|
|
270
|
+
|
|
261
271
|
for command in commands:
|
|
262
272
|
obj = self.model(
|
|
263
273
|
entity_id=obj.entity_id,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: edu-rdm-integration
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.19.0
|
|
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
|
|
@@ -197,6 +197,7 @@ INSTALLED_APPS = (
|
|
|
197
197
|
('uploader_client', 'ORGANIZATION_OGRN'): '',
|
|
198
198
|
('uploader_client', 'INSTALLATION_NAME'): '',
|
|
199
199
|
('uploader_client', 'INSTALLATION_ID'): '',
|
|
200
|
+
('rdm_cleanup_outdated_data', 'ENABLE_CLEANUP_MODELS_OUTDATED_DATA'): False,
|
|
200
201
|
})
|
|
201
202
|
```
|
|
202
203
|
- Получение значений настроек из конфигурационного файла в settings.py:
|
|
@@ -309,6 +310,9 @@ INSTALLED_APPS = (
|
|
|
309
310
|
# Директория логов отправки данных в витрину, доступных для скачивания
|
|
310
311
|
RDM_UPLOAD_LOG_DIR = os.path.join('logs', 'rdm', 'upload')
|
|
311
312
|
os.makedirs(os.path.join(MEDIA_ROOT, RDM_UPLOAD_LOG_DIR), exist_ok=True)
|
|
313
|
+
|
|
314
|
+
# Включить зачистку устаревших данных моделей РВД
|
|
315
|
+
RDM_ENABLE_CLEANUP_MODELS_OUTDATED_DATA = conf.get_bool('rdm_cleanup_outdated_data', 'ENABLE_CLEANUP_MODELS_OUTDATED_DATA')
|
|
312
316
|
```
|
|
313
317
|
|
|
314
318
|
Перечень настроек в settings.py указан в таблице ниже.
|
|
@@ -368,6 +372,7 @@ INSTALLED_APPS = (
|
|
|
368
372
|
| RDM_COLLECT_LOG_DIR | Директория логов сбора данных, доступных для скачивания | |
|
|
369
373
|
| RDM_EXPORT_LOG_DIR | Директория логов экспорта данных, доступных для скачивания | |
|
|
370
374
|
| RDM_UPLOAD_LOG_DIR | Директория логов отправки данных в витрину, доступных для скачивания | |
|
|
375
|
+
| RDM_ENABLE_CLEANUP_MODELS_OUTDATED_DATA | Включение зачистки устаревших данных моделей РВД | False |
|
|
371
376
|
|
|
372
377
|
- В дефолтный конфиг проекта необходимо добавить:
|
|
373
378
|
|
|
@@ -463,6 +468,11 @@ INSTALLED_APPS = (
|
|
|
463
468
|
INSTALLATION_NAME =
|
|
464
469
|
# Идентификатор инсталляции в целевой Витрине
|
|
465
470
|
INSTALLATION_ID =
|
|
471
|
+
|
|
472
|
+
# Настройка зачистки устаревших данных
|
|
473
|
+
[rdm_cleanup_outdated_data]
|
|
474
|
+
# Включить зачистку устаревших данных моделей РВД
|
|
475
|
+
ENABLE_CLEANUP_MODELS_OUTDATED_DATA = False
|
|
466
476
|
```
|
|
467
477
|
На основе дефолтного конфига произвести конфигурирование приложений.
|
|
468
478
|
|
|
@@ -48,7 +48,7 @@ edu_rdm_integration/pipelines/cleanup_outdated_data/__init__.py,sha256=47DEQpj8H
|
|
|
48
48
|
edu_rdm_integration/pipelines/cleanup_outdated_data/apps.py,sha256=tyTlr1Wt574eby2vIV68FMm7SPFSZKYw6zNkD8x6COE,507
|
|
49
49
|
edu_rdm_integration/pipelines/cleanup_outdated_data/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
50
|
edu_rdm_integration/pipelines/cleanup_outdated_data/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
|
-
edu_rdm_integration/pipelines/cleanup_outdated_data/management/commands/rdm_cleanup_outdated_data.py,sha256=
|
|
51
|
+
edu_rdm_integration/pipelines/cleanup_outdated_data/management/commands/rdm_cleanup_outdated_data.py,sha256=JsmMCv9dQpy0flyJr2gviG0A57FG7JcLAHKO-If_VGY,2909
|
|
52
52
|
edu_rdm_integration/pipelines/transfer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
53
|
edu_rdm_integration/pipelines/transfer/actions.py,sha256=e94NVtTcFIqBBTZ9vbSfh_0oXUWK9ZOx2pDYnIePJVc,5920
|
|
54
54
|
edu_rdm_integration/pipelines/transfer/app_meta.py,sha256=jshfepDDJrbCACtJBJBPuidAVJ6rcziQiet27wqOIjk,373
|
|
@@ -211,7 +211,7 @@ edu_rdm_integration/stages/export_data/migrations/0001_initial.py,sha256=h7HIT-Q
|
|
|
211
211
|
edu_rdm_integration/stages/export_data/migrations/0002_auto_20250704_0810.py,sha256=yjGlH25Mke2_VAe188LEkWZ04Xy1qenai7D2zOA-ecY,1558
|
|
212
212
|
edu_rdm_integration/stages/export_data/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
213
213
|
edu_rdm_integration/stages/export_data/registry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
214
|
-
edu_rdm_integration/stages/export_data/registry/actions.py,sha256=
|
|
214
|
+
edu_rdm_integration/stages/export_data/registry/actions.py,sha256=C5qLwGQeVd9ddOKo2zBJKBLtYn5x_8XV2MaTjK-SGFM,10940
|
|
215
215
|
edu_rdm_integration/stages/export_data/registry/apps.py,sha256=71DtJQ2ULt8_3CnTu2VAfT5ABBrDNY1nKTmZ6UtvIpw,448
|
|
216
216
|
edu_rdm_integration/stages/export_data/registry/ui.py,sha256=0kWWfOmtTyN4SUO9dGUcEz0wgOPA111jHoWw3_LNPqI,6238
|
|
217
217
|
edu_rdm_integration/stages/export_data/registry/templates/ui-js/create-export-command-win.js,sha256=g0dpYsvd_6VfRU4nRv3tNK-0wtMND_VurQRT04ShJjk,1341
|
|
@@ -254,8 +254,8 @@ edu_rdm_integration/stages/upload_data/uploader_log/ui.py,sha256=mU3XA9zVKHGqzNk
|
|
|
254
254
|
edu_rdm_integration/stages/upload_data/uploader_log/migrations/0001_initial.py,sha256=r5oOB7DBK9-mfuqPAgjXUJY5-hEcmMdILCwDTpaLnBc,753
|
|
255
255
|
edu_rdm_integration/stages/upload_data/uploader_log/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
256
256
|
edu_rdm_integration/stages/upload_data/uploader_log/templates/ui-js/object-grid-buttons.js,sha256=2xyGe0wdVokM0RhpzRzcRvJPBkBmPe3SlZry4oP4Nzs,6201
|
|
257
|
-
edu_rdm_integration-3.
|
|
258
|
-
edu_rdm_integration-3.
|
|
259
|
-
edu_rdm_integration-3.
|
|
260
|
-
edu_rdm_integration-3.
|
|
261
|
-
edu_rdm_integration-3.
|
|
257
|
+
edu_rdm_integration-3.19.0.dist-info/licenses/LICENSE,sha256=uw43Gjjj-1vXWCItfSrNDpbejnOwZMrNerUh8oWbq8Q,3458
|
|
258
|
+
edu_rdm_integration-3.19.0.dist-info/METADATA,sha256=gkLcjt7nQkq_sHfhr72YjL_pF2wlDIk9zCxRNmYkUy4,40693
|
|
259
|
+
edu_rdm_integration-3.19.0.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
|
260
|
+
edu_rdm_integration-3.19.0.dist-info/top_level.txt,sha256=nRJV0O14UtNE-jGIYG03sohgFnZClvf57H5m6VBXe9Y,20
|
|
261
|
+
edu_rdm_integration-3.19.0.dist-info/RECORD,,
|
|
File without changes
|
{edu_rdm_integration-3.18.4.dist-info → edu_rdm_integration-3.19.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|