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

@@ -2,6 +2,9 @@ from django.core.management import (
2
2
  BaseCommand,
3
3
  )
4
4
 
5
+ from edu_rdm_integration.rdm_models.models import (
6
+ RDMModelEnum,
7
+ )
5
8
  from edu_rdm_integration.stages.service.model_outdated_data.managers import (
6
9
  ModelOutdatedDataCleanerManager,
7
10
  )
@@ -14,7 +17,23 @@ class Command(BaseCommand):
14
17
 
15
18
  help = 'Ночная команда для очистки устаревших данных РВД.'
16
19
 
20
+ def add_arguments(self, parser):
21
+ models = ', '.join(f'{key} - {value.title}' for key, value in RDMModelEnum.get_enum_data().items())
22
+ models_help_text = (
23
+ f'Значением параметра является перечисление моделей РВД, для которых должна быть произведена зачистка '
24
+ f'устаревших данных. '
25
+ f'Перечисление моделей:\n{models}. Если модели не указываются, то зачистка устаревших данных будет '
26
+ f'производиться для всех моделей. Модели перечисляются через запятую без пробелов.'
27
+ )
28
+ parser.add_argument(
29
+ '--models',
30
+ action='store',
31
+ dest='models',
32
+ type=lambda ml: [m.strip().upper() for m in ml.strip().split(',')] if ml else None,
33
+ help=models_help_text,
34
+ )
35
+
17
36
  def handle(self, *args, **options):
18
37
  """Запуск очистки устаревших данных РВД."""
19
- model_data_cleaner_manager = ModelOutdatedDataCleanerManager()
38
+ model_data_cleaner_manager = ModelOutdatedDataCleanerManager(models=options['models'])
20
39
  model_data_cleaner_manager.run()
@@ -1,6 +1,7 @@
1
1
  import importlib
2
2
  from typing import (
3
3
  TYPE_CHECKING,
4
+ Optional,
4
5
  )
5
6
 
6
7
  from edu_rdm_integration.rdm_models.models import (
@@ -22,6 +23,11 @@ class ModelOutdatedDataCleanerManager:
22
23
  метод run.
23
24
  """
24
25
 
26
+ def __init__(self, *args, models: Optional[list[str]] = None, **kwargs):
27
+ self._models = models
28
+
29
+ super().__init__(*args, **kwargs)
30
+
25
31
  def _process_model(self, model_enum_value: 'ModelEnumValue'):
26
32
  """Обрабатывает модель РВД."""
27
33
  if not hasattr(model_enum_value, 'outdated_data_cleaners'):
@@ -38,6 +44,9 @@ class ModelOutdatedDataCleanerManager:
38
44
  def _process_models(self):
39
45
  """Обрабатывает все модели РВД."""
40
46
  for model_enum_value in RDMModelEnum.get_model_enum_values():
47
+ if self._models is not None and model_enum_value.key not in self._models:
48
+ continue
49
+
41
50
  self._process_model(model_enum_value=model_enum_value)
42
51
 
43
52
  def run(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: edu-rdm-integration
3
- Version: 3.18.2
3
+ Version: 3.18.3
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
@@ -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=Mhas_dqs3NPpCKyRxdGFkQCrsic8_48fRDFhVAmq2MU,676
51
+ edu_rdm_integration/pipelines/cleanup_outdated_data/management/commands/rdm_cleanup_outdated_data.py,sha256=XgRoaXyRiJ08En4y1dMGIjr3ES5BPzjU3kpik66ubuo,1811
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
@@ -221,8 +221,8 @@ edu_rdm_integration/stages/service/apps.py,sha256=lgCG4_kpwgfDWh6y-GNuUwz5SOjkP7
221
221
  edu_rdm_integration/stages/service/tasks.py,sha256=PPCtT6EpLkAKRczY0KIT6GeE9eBkv60fl2W6KFvCRqc,2302
222
222
  edu_rdm_integration/stages/service/model_outdated_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
223
223
  edu_rdm_integration/stages/service/model_outdated_data/cleaners.py,sha256=gk5_wUNVJwr3D6k5fJDzbSGEhWUXqk9yT6xPK7OP1hw,637
224
- edu_rdm_integration/stages/service/model_outdated_data/managers.py,sha256=U2rBg-t-X9YfapP4xRRfKiou7sX0V10WxrPHyeCQ-oI,1880
225
- edu_rdm_integration/stages/service/outdated_service_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
224
+ edu_rdm_integration/stages/service/model_outdated_data/managers.py,sha256=vtHqhdeRXs8qAGltG6YF8gplmAeOQuPIBmrFWGeR7FI,2157
225
+ edu_rdm_integration/stages/service/service_outdated_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
226
226
  edu_rdm_integration/stages/upload_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
227
227
  edu_rdm_integration/stages/upload_data/apps.py,sha256=aFhVPK-65b35CGKoAeAgQ0mm3STaWtZg7rqk3eL-b7s,620
228
228
  edu_rdm_integration/stages/upload_data/consts.py,sha256=yTygXxS5dBRCvrE7Q3D0jEGSC5apIKvVAAViDM8QcKA,223
@@ -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.18.2.dist-info/licenses/LICENSE,sha256=uw43Gjjj-1vXWCItfSrNDpbejnOwZMrNerUh8oWbq8Q,3458
258
- edu_rdm_integration-3.18.2.dist-info/METADATA,sha256=zd1jKvBCnNe9yQII04MTYP7vkbcpmHsnH-3TIz1xMdY,39873
259
- edu_rdm_integration-3.18.2.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
260
- edu_rdm_integration-3.18.2.dist-info/top_level.txt,sha256=nRJV0O14UtNE-jGIYG03sohgFnZClvf57H5m6VBXe9Y,20
261
- edu_rdm_integration-3.18.2.dist-info/RECORD,,
257
+ edu_rdm_integration-3.18.3.dist-info/licenses/LICENSE,sha256=uw43Gjjj-1vXWCItfSrNDpbejnOwZMrNerUh8oWbq8Q,3458
258
+ edu_rdm_integration-3.18.3.dist-info/METADATA,sha256=syepnxnmUeKndzEB4uSzmDy_GfWDFTuzub7AwTKcFIs,39873
259
+ edu_rdm_integration-3.18.3.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
260
+ edu_rdm_integration-3.18.3.dist-info/top_level.txt,sha256=nRJV0O14UtNE-jGIYG03sohgFnZClvf57H5m6VBXe9Y,20
261
+ edu_rdm_integration-3.18.3.dist-info/RECORD,,