educommon 3.6.0__py3-none-any.whl → 3.6.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.
- educommon/audit_log/helpers.py +1 -1
- educommon/integration_entities/helpers.py +22 -0
- educommon/version.conf +5 -5
- {educommon-3.6.0.dist-info → educommon-3.6.1.dist-info}/METADATA +2 -2
- {educommon-3.6.0.dist-info → educommon-3.6.1.dist-info}/RECORD +8 -8
- {educommon-3.6.0.dist-info → educommon-3.6.1.dist-info}/WHEEL +0 -0
- {educommon-3.6.0.dist-info → educommon-3.6.1.dist-info}/dependency_links.txt +0 -0
- {educommon-3.6.0.dist-info → educommon-3.6.1.dist-info}/top_level.txt +0 -0
educommon/audit_log/helpers.py
CHANGED
@@ -19,6 +19,10 @@ from django.utils import (
|
|
19
19
|
timezone,
|
20
20
|
)
|
21
21
|
|
22
|
+
from m3_db_utils.models import (
|
23
|
+
FictiveForeignKeyMixin,
|
24
|
+
)
|
25
|
+
|
22
26
|
from educommon.integration_entities.enums import (
|
23
27
|
EntityLogOperation,
|
24
28
|
)
|
@@ -75,8 +79,24 @@ class AbstractEntitySaver(ABC):
|
|
75
79
|
"""
|
76
80
|
return []
|
77
81
|
|
82
|
+
def _convert_fictive_foreign_keys(self, entities: Iterable[Model]):
|
83
|
+
"""Преобразование значений полей фиктивных внешних ключей.
|
84
|
+
|
85
|
+
В рамках метода производится проверка наличия фиктивного внешнего ключа у модели. Если они есть и заполнены
|
86
|
+
объектами модели, то производится получения идентификатора объекта модели и замена им самого объекта.
|
87
|
+
"""
|
88
|
+
for entity in entities:
|
89
|
+
if isinstance(entity, FictiveForeignKeyMixin):
|
90
|
+
for field_name in entity.fictive_foreign_key_field_names:
|
91
|
+
field_value = getattr(entity, field_name, None)
|
92
|
+
|
93
|
+
if field_value and isinstance(field_value, Model):
|
94
|
+
setattr(entity, field_name, getattr(field_value, 'pk'))
|
95
|
+
|
78
96
|
def _create_entities(self) -> None:
|
79
97
|
"""Создает новые записи."""
|
98
|
+
self._convert_fictive_foreign_keys(entities=self._to_create_entities)
|
99
|
+
|
80
100
|
self.model.objects.bulk_create(
|
81
101
|
self._to_create_entities,
|
82
102
|
batch_size=self.create_batch_size,
|
@@ -85,6 +105,8 @@ class AbstractEntitySaver(ABC):
|
|
85
105
|
|
86
106
|
def _update_entities(self) -> None:
|
87
107
|
"""Обновляет записи."""
|
108
|
+
self._convert_fictive_foreign_keys(entities=self._to_create_entities)
|
109
|
+
|
88
110
|
for entity in self._to_update_entities:
|
89
111
|
# Поле modified имеет свойство auto_now=True и оно не обновляется при update и bulk_update.
|
90
112
|
# Поэтому, его нужно обновить вручную:
|
educommon/version.conf
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
# нормальной установки обновлений.
|
5
5
|
|
6
6
|
[version]
|
7
|
-
BRANCH = tags/3.6.
|
8
|
-
VERSION = 3.6.
|
9
|
-
REVISION =
|
10
|
-
VERSION_DATE =
|
11
|
-
REVISION_DATE =
|
7
|
+
BRANCH = tags/3.6.1
|
8
|
+
VERSION = 3.6.1
|
9
|
+
REVISION = 5c849c3a296d1e7c1b370e73a9a661b385c43293
|
10
|
+
VERSION_DATE = 16.12.2023
|
11
|
+
REVISION_DATE = 16.12.2023
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: educommon
|
3
|
-
Version: 3.6.
|
3
|
+
Version: 3.6.1
|
4
4
|
Summary: Общая кодовая база для проектов БЦ Образование
|
5
5
|
Home-page: https://stash.bars-open.ru/projects/EDUBASE/repos/educommon
|
6
6
|
Author: BARS Group
|
@@ -34,7 +34,7 @@ Requires-Dist: celery
|
|
34
34
|
Requires-Dist: spyne
|
35
35
|
Requires-Dist: xlsxwriter <1,>=0.9.3
|
36
36
|
Requires-Dist: m3-builder <2,>=1.2
|
37
|
-
Requires-Dist: m3-db-utils >=0.3.
|
37
|
+
Requires-Dist: m3-db-utils >=0.3.11
|
38
38
|
Requires-Dist: m3-django-compat <2,>=1.9.1
|
39
39
|
Requires-Dist: m3-core <3,>=2.2.16
|
40
40
|
Requires-Dist: m3-ui <3,>=2.2.40
|
@@ -1,6 +1,6 @@
|
|
1
1
|
educommon/__init__.py,sha256=fvsBDL7g8HgOTd-JHOh7TSvMcnUauvGVgPuyA2Z9hUI,419
|
2
2
|
educommon/thread_data.py,sha256=n0XtdesP9H92O3rJ8K6fVnJLiHqyJEfh2xpuT36wzxs,61
|
3
|
-
educommon/version.conf,sha256=
|
3
|
+
educommon/version.conf,sha256=CyZ0wpuD4ZOjQH46Sg9nCZPExDS0F8wrAc0C3w-oTOs,448
|
4
4
|
educommon/about/README.rst,sha256=U48UW5jv-8qHyaV56atzzkNMvzHKXVcWSb_NR06PnMo,2685
|
5
5
|
educommon/about/__init__.py,sha256=H1W0IgW-qX9LCZ49GOJzHdmQGHhh-MA6U1xmNx7WnfM,132
|
6
6
|
educommon/about/apps.py,sha256=GrpJAOE2sF0ukWsqugP_WJS88DO4aL-T3kTLprrJrcA,259
|
@@ -29,7 +29,7 @@ educommon/audit_log/actions.py,sha256=hPlnFK8Q8uITA6Rn0CvAyxo76pxVGC1X-g8vzWphgG
|
|
29
29
|
educommon/audit_log/app_meta.py,sha256=fMPgP5S6kDe_lskTEhPVLzjDLDhoVPKCIjUeD4L7sHA,310
|
30
30
|
educommon/audit_log/apps.py,sha256=zHeBEoF8HVNc6YIIQTW-lpEMXjrywnB23uqxXIR9IKg,5033
|
31
31
|
educommon/audit_log/constants.py,sha256=96Gp-rYpt6poKAu8LbXY_0aApdOWYBy09235kAB0rSo,880
|
32
|
-
educommon/audit_log/helpers.py,sha256=
|
32
|
+
educommon/audit_log/helpers.py,sha256=qJLV6yVgf3Z-Mgalc6kGfFvxk8h1L4bTO9fdSL36OPk,738
|
33
33
|
educommon/audit_log/middleware.py,sha256=HkxBh-1RQJnhKqckkXaMbFjJ34WgZGJssbk04wiS3ts,1140
|
34
34
|
educommon/audit_log/models.py,sha256=F4KW-sdGbKxIKdo3GKpPeu66ykO32MxYZ5afvT_Clyg,8305
|
35
35
|
educommon/audit_log/permissions.py,sha256=VB040UAY4_KmqM4ioToHlVHQYSE7OP0qHEUn9bnWUSo,1241
|
@@ -178,7 +178,7 @@ educommon/integration_entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
|
|
178
178
|
educommon/integration_entities/consts.py,sha256=XMSR-9Q5cLSXe6Bn0JWFQQ8UfTyJfs7LYT1klj0Xvsc,448
|
179
179
|
educommon/integration_entities/entities.py,sha256=v4QQPb8NeQJMdgxjfEcY9_NmPGasQbRPoA10gZEMAjU,2005
|
180
180
|
educommon/integration_entities/enums.py,sha256=MPS3F402TMUP9wDJXBgNHoktVOf-zM8lAD22QphnLtU,335
|
181
|
-
educommon/integration_entities/helpers.py,sha256=
|
181
|
+
educommon/integration_entities/helpers.py,sha256=ETX_sn6PeKpUK9mBQQ3vtJy143EklRRB6koOQtpc-5I,9888
|
182
182
|
educommon/integration_entities/mixins.py,sha256=wWb2nA8BAtDC3dAn66CkpvGwrW17E_tJE9f6BcI9EXg,1122
|
183
183
|
educommon/ioc/__init__.py,sha256=1X6uu-hwwxbwRZ6g0whIE04GbpXgU7K80QmtE0v-4kQ,4028
|
184
184
|
educommon/logger/__init__.py,sha256=KhXTyv0V96wX_6QShkVrRIk_mqJtDYpeBMBb8PtBl-A,822
|
@@ -325,8 +325,8 @@ educommon/ws_log/smev/exceptions.py,sha256=lmy7o2T3dJkqgIhG07qyh5yPqO3qZAYABuT4J
|
|
325
325
|
educommon/ws_log/templates/report/smev_logs.xlsx,sha256=nnYgB0Z_ix8HoxsRICjsZfFRQBdra-5Gd8nWhCxTjYg,10439
|
326
326
|
educommon/ws_log/templates/ui-js/smev-logs-list-window.js,sha256=AGup3D8GTJSY9WdDPj0zBJeYQBFOmGgcbxPOJbKK-nY,513
|
327
327
|
educommon/ws_log/templates/ui-js/smev-logs-report-setting-window.js,sha256=nQ7QYK9frJcE7g7kIt6INg9TlEEJAPPayBJgRaoTePA,1103
|
328
|
-
educommon-3.6.
|
329
|
-
educommon-3.6.
|
330
|
-
educommon-3.6.
|
331
|
-
educommon-3.6.
|
332
|
-
educommon-3.6.
|
328
|
+
educommon-3.6.1.dist-info/METADATA,sha256=j7fq3ajpRnYwfk1aYrW_xomuaEyvu5SBE8ePinJisTY,1736
|
329
|
+
educommon-3.6.1.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
330
|
+
educommon-3.6.1.dist-info/dependency_links.txt,sha256=RNlr4t-BxZRm7e_IfVo1ikr5ln-7viimzLHvQMO1C_Q,43
|
331
|
+
educommon-3.6.1.dist-info/top_level.txt,sha256=z5fbW7bz_0V1foUm_FGcZ9_MTpW3N1dBN7-kEmMowl4,10
|
332
|
+
educommon-3.6.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|