aiteamutils 0.2.156__py3-none-any.whl → 0.2.157__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.
aiteamutils/base_service.py
CHANGED
@@ -144,6 +144,12 @@ class BaseService(Generic[ModelType]):
|
|
144
144
|
if operation != "delete" and separated_files:
|
145
145
|
logger.info("[새 파일 저장 시작]")
|
146
146
|
from .files import FileHandler
|
147
|
+
|
148
|
+
# 임시 엔티티인 경우 파일 저장 건너뛰기
|
149
|
+
if isinstance(entity_result, type('TempEntity', (), {})):
|
150
|
+
logger.info("[임시 엔티티 감지] 파일 저장 건너뛰기")
|
151
|
+
return entity_data_copy, {}
|
152
|
+
|
147
153
|
for field_name, files in separated_files.items():
|
148
154
|
logger.info(f"[필드 처리] {field_name}, 파일 수: {len(files)}")
|
149
155
|
saved_files = await FileHandler.save_files(
|
@@ -248,17 +254,28 @@ class BaseService(Generic[ModelType]):
|
|
248
254
|
if fk_check:
|
249
255
|
await validate_unique_fields(self.db_session, fk_check, find_value=False)
|
250
256
|
|
251
|
-
#
|
252
|
-
|
257
|
+
# 파일 데이터 분리를 위한 임시 엔티티 생성
|
258
|
+
temp_entity = type('TempEntity', (), {'ulid': str(ULID())})()
|
259
|
+
|
260
|
+
# 파일 데이터 분리
|
261
|
+
entity_data_copy, _ = await self._process_files(
|
253
262
|
entity_data=entity_data,
|
263
|
+
entity_result=temp_entity,
|
264
|
+
storage_dir=storage_dir,
|
265
|
+
operation="create"
|
266
|
+
)
|
267
|
+
|
268
|
+
# 엔티티 생성 (파일 데이터가 제거된 상태)
|
269
|
+
result = await self.repository.create(
|
270
|
+
entity_data=entity_data_copy,
|
254
271
|
exclude_entities=exclude_entities
|
255
272
|
)
|
256
273
|
|
257
|
-
# 파일
|
274
|
+
# 실제 파일 저장 및 엔티티 업데이트
|
258
275
|
if storage_dir:
|
259
|
-
|
260
|
-
entity_data=entity_data,
|
261
|
-
entity_result=result,
|
276
|
+
_, file_infos = await self._process_files(
|
277
|
+
entity_data=entity_data, # 원본 데이터 사용
|
278
|
+
entity_result=result, # 실제 엔티티 사용
|
262
279
|
storage_dir=storage_dir,
|
263
280
|
operation="create"
|
264
281
|
)
|
aiteamutils/version.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
"""버전 정보"""
|
2
|
-
__version__ = "0.2.
|
2
|
+
__version__ = "0.2.157"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
aiteamutils/__init__.py,sha256=kRBpRjark0M8ZwFfmKiMFol6CbIILN3WE4f6_P6iIq0,1089
|
2
2
|
aiteamutils/base_model.py,sha256=yBZqzTDF9PA4wCAvmYfG12FdVwLtxOEUCcA3z2i6fXU,4176
|
3
3
|
aiteamutils/base_repository.py,sha256=Oy2zE1i5qx60Xf1tnsaKLyFWapiPqt5JH8NejwNrPWg,4647
|
4
|
-
aiteamutils/base_service.py,sha256=
|
4
|
+
aiteamutils/base_service.py,sha256=uoeeYUr-TAm2CaGUvjO74U2_nAAQdC6ZTSv8hiVsrcg,23866
|
5
5
|
aiteamutils/cache.py,sha256=07xBGlgAwOTAdY5mnMOQJ5EBxVwe8glVD7DkGEkxCtw,1373
|
6
6
|
aiteamutils/config.py,sha256=YdalpJb70-txhGJAS4aaKglEZAFVWgfzw5BXSWpkUz4,3232
|
7
7
|
aiteamutils/database.py,sha256=msvBKtxWeQVOo0v2Q9i2azuTNtnUItuNNar52gdRZTo,20418
|
@@ -11,7 +11,7 @@ aiteamutils/files.py,sha256=Qq2w3VAEOzvsDirYtxRTN48LnIzf4TPUH2LftmyYtQk,12831
|
|
11
11
|
aiteamutils/models.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
|
12
12
|
aiteamutils/security.py,sha256=McUl3t5Z5SyUDVUHymHdDkYyF4YSeg4g9fFMML4W6Kw,11630
|
13
13
|
aiteamutils/validators.py,sha256=_WHN6jqJQzKM5uPTg-Da8U2qqevS84XeKMkCCF4C_lY,9591
|
14
|
-
aiteamutils/version.py,sha256=
|
15
|
-
aiteamutils-0.2.
|
16
|
-
aiteamutils-0.2.
|
17
|
-
aiteamutils-0.2.
|
14
|
+
aiteamutils/version.py,sha256=zzhDPxUCDTkincSRtbo_y2fTIxFwm8eppgXa_Unb-L0,43
|
15
|
+
aiteamutils-0.2.157.dist-info/METADATA,sha256=g7aZN3zbtNOAnu07UJSQWePUB-o10qRpBuiJmXj_6FQ,1743
|
16
|
+
aiteamutils-0.2.157.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
17
|
+
aiteamutils-0.2.157.dist-info/RECORD,,
|
File without changes
|