aiteamutils 0.2.165__py3-none-any.whl → 0.2.167__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/database.py
CHANGED
@@ -159,9 +159,24 @@ def process_response(
|
|
159
159
|
if not entity:
|
160
160
|
return None
|
161
161
|
|
162
|
-
|
163
|
-
|
164
|
-
|
162
|
+
if isinstance(entity, tuple):
|
163
|
+
main_entity = entity[0] # 첫 번째는 Project
|
164
|
+
joined_entities = entity[1:] # 두 번째는 CoreUserView
|
165
|
+
|
166
|
+
# 주 엔티티 처리
|
167
|
+
result = process_columns(main_entity)
|
168
|
+
|
169
|
+
# 조인된 엔티티들 처리
|
170
|
+
for joined_entity in joined_entities:
|
171
|
+
if joined_entity:
|
172
|
+
# 테이블명을 키로 사용
|
173
|
+
table_name = joined_entity.__table__.name
|
174
|
+
joined_data = process_columns(joined_entity)
|
175
|
+
result[table_name] = joined_data
|
176
|
+
else:
|
177
|
+
# 모든 필드 처리
|
178
|
+
result = process_columns(entity)
|
179
|
+
|
165
180
|
# Relationship 처리 (이미 로드된 관계만 처리)
|
166
181
|
for relationship in entity.__mapper__.relationships:
|
167
182
|
if not relationship.key in entity.__dict__:
|
@@ -462,14 +477,14 @@ async def list_entities(
|
|
462
477
|
query = select(model)
|
463
478
|
|
464
479
|
# 명시적 조인 적용
|
480
|
+
has_explicit_joins = False
|
465
481
|
if explicit_joins:
|
466
482
|
for join_target in explicit_joins:
|
467
483
|
if isinstance(join_target, tuple):
|
468
|
-
# (모델, 조인조건)이 전달된 경우
|
469
484
|
target_model, join_condition = join_target
|
470
485
|
query = query.outerjoin(target_model, join_condition)
|
486
|
+
has_explicit_joins = True
|
471
487
|
else:
|
472
|
-
# 모델만 전달된 경우
|
473
488
|
query = query.outerjoin(join_target)
|
474
489
|
|
475
490
|
# 로딩 조인 적용
|
@@ -501,8 +516,15 @@ async def list_entities(
|
|
501
516
|
# 페이지네이션 적용
|
502
517
|
query = query.limit(limit).offset(skip)
|
503
518
|
|
519
|
+
# 결과 처리
|
504
520
|
result = await session.execute(query)
|
505
|
-
|
521
|
+
if has_explicit_joins:
|
522
|
+
# 명시적 조인이 있는 경우
|
523
|
+
return result.unique().all()
|
524
|
+
else:
|
525
|
+
# 기존 방식 유지
|
526
|
+
return result.unique().scalars().all()
|
527
|
+
|
506
528
|
except SQLAlchemyError as e:
|
507
529
|
raise CustomException(
|
508
530
|
ErrorCode.DB_READ_ERROR,
|
aiteamutils/version.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
"""버전 정보"""
|
2
|
-
__version__ = "0.2.
|
2
|
+
__version__ = "0.2.167"
|
@@ -4,13 +4,13 @@ aiteamutils/base_repository.py,sha256=Oy2zE1i5qx60Xf1tnsaKLyFWapiPqt5JH8NejwNrPW
|
|
4
4
|
aiteamutils/base_service.py,sha256=JIeRtFn1Ll4Qcq3v88pgS9lmEQLQoVyyOKqYR8n02S4,21192
|
5
5
|
aiteamutils/cache.py,sha256=07xBGlgAwOTAdY5mnMOQJ5EBxVwe8glVD7DkGEkxCtw,1373
|
6
6
|
aiteamutils/config.py,sha256=YdalpJb70-txhGJAS4aaKglEZAFVWgfzw5BXSWpkUz4,3232
|
7
|
-
aiteamutils/database.py,sha256=
|
7
|
+
aiteamutils/database.py,sha256=vY-uHNRgWpXJtlIOlUIW1pdw1Vp6aBfqiEQoWFOWKlI,22441
|
8
8
|
aiteamutils/enums.py,sha256=7WLqlcJqQWtETAga2WAxNp3dJTQIAd2TW-4WzkoHHa8,2498
|
9
9
|
aiteamutils/exceptions.py,sha256=sgIVulllKMM9InTltaB7VD6i7DiQvCoycexsV-BiIBY,16570
|
10
10
|
aiteamutils/files.py,sha256=fxnCu9rErd4vCovMi0jy4adLUiA7rx_q4RdOL4wSgsU,14258
|
11
11
|
aiteamutils/security.py,sha256=McUl3t5Z5SyUDVUHymHdDkYyF4YSeg4g9fFMML4W6Kw,11630
|
12
12
|
aiteamutils/validators.py,sha256=_WHN6jqJQzKM5uPTg-Da8U2qqevS84XeKMkCCF4C_lY,9591
|
13
|
-
aiteamutils/version.py,sha256=
|
14
|
-
aiteamutils-0.2.
|
15
|
-
aiteamutils-0.2.
|
16
|
-
aiteamutils-0.2.
|
13
|
+
aiteamutils/version.py,sha256=Hfd-l22aoJLfw2sVPoJQM2eCzjDT_O5m3dwO3kblca8,43
|
14
|
+
aiteamutils-0.2.167.dist-info/METADATA,sha256=4bIneIT-Uv0rFw7TbuoOfRYCdhBXFRSdhrR_0FgVitE,1743
|
15
|
+
aiteamutils-0.2.167.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
16
|
+
aiteamutils-0.2.167.dist-info/RECORD,,
|
File without changes
|