agentic-kit-common 0.0.5__py3-none-any.whl → 0.0.7__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 agentic-kit-common might be problematic. Click here for more details.
- agentic_kit_common/orm/manager.py +8 -6
- {agentic_kit_common-0.0.5.dist-info → agentic_kit_common-0.0.7.dist-info}/METADATA +1 -1
- {agentic_kit_common-0.0.5.dist-info → agentic_kit_common-0.0.7.dist-info}/RECORD +5 -5
- {agentic_kit_common-0.0.5.dist-info → agentic_kit_common-0.0.7.dist-info}/WHEEL +0 -0
- {agentic_kit_common-0.0.5.dist-info → agentic_kit_common-0.0.7.dist-info}/top_level.txt +0 -0
|
@@ -14,8 +14,7 @@ class BaseOrmManager(object):
|
|
|
14
14
|
def get_by_id(cls, obj_id, close_session_after_curd=False):
|
|
15
15
|
with get_db_session() as db:
|
|
16
16
|
query = db.query(cls._model_cls) \
|
|
17
|
-
.filter(cls._model_cls.id == obj_id)
|
|
18
|
-
.filter(cls._model_cls.active == True)
|
|
17
|
+
.filter(cls._model_cls.id == obj_id)
|
|
19
18
|
|
|
20
19
|
if hasattr(cls._model_cls, 'active'):
|
|
21
20
|
query = query.filter(cls._model_cls.active == 1)
|
|
@@ -51,7 +50,7 @@ class BaseOrmManager(object):
|
|
|
51
50
|
return res
|
|
52
51
|
|
|
53
52
|
@classmethod
|
|
54
|
-
def get_list(cls, paginate=False, close_session_after_curd=False, **kwargs):
|
|
53
|
+
def get_list(cls, paginate=False, close_session_after_curd=False, render: bool = True, **kwargs):
|
|
55
54
|
with get_db_session() as db:
|
|
56
55
|
query = db.query(cls._model_cls)
|
|
57
56
|
# """分页查询示例"""
|
|
@@ -92,6 +91,8 @@ class BaseOrmManager(object):
|
|
|
92
91
|
|
|
93
92
|
# 查询记录
|
|
94
93
|
result = query.all()
|
|
94
|
+
if render:
|
|
95
|
+
result = [cls.render(item) for item in result]
|
|
95
96
|
pagination = {
|
|
96
97
|
'total': total,
|
|
97
98
|
'page': page,
|
|
@@ -124,9 +125,10 @@ class BaseOrmManager(object):
|
|
|
124
125
|
@classmethod
|
|
125
126
|
def soft_delete_obj(cls, obj):
|
|
126
127
|
"""软删除obj信息"""
|
|
127
|
-
cls.
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
if hasattr(cls._model_cls, 'active'):
|
|
129
|
+
cls.update_obj(obj, **{
|
|
130
|
+
'active': False
|
|
131
|
+
})
|
|
130
132
|
return obj
|
|
131
133
|
|
|
132
134
|
@classmethod
|
|
@@ -3,7 +3,7 @@ agentic_kit_common/minio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
3
3
|
agentic_kit_common/minio/minio_manager.py,sha256=PzoUWn0YqXTHx1UClbkwLkIUmv5O4aSDc7eVf08qOzs,21494
|
|
4
4
|
agentic_kit_common/orm/__init__.py,sha256=wqY81g3P7FftFvLK5SaxFJzNNxrQwtmcb4RCXOSAZa8,71
|
|
5
5
|
agentic_kit_common/orm/base.py,sha256=QIura_i2nIY2XeA3-KkO2loLNbEAoJK2qx0hu_8nhYU,2277
|
|
6
|
-
agentic_kit_common/orm/manager.py,sha256=
|
|
6
|
+
agentic_kit_common/orm/manager.py,sha256=KRL5kOwceEKgjwjxkzCBSkeNME6C328xdDKH06dMeB8,4764
|
|
7
7
|
agentic_kit_common/orm/session.py,sha256=LX4ZUKJNXdcQ0KqRt5L0pJX-QG-tDyKXEDijcPUkGD0,2716
|
|
8
8
|
agentic_kit_common/vector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
agentic_kit_common/vector/embedding/__init__.py,sha256=mp--cfCDzTn5hNxzcIAU4m0g4F0d0rrZErFVWsGDvx4,40
|
|
@@ -22,7 +22,7 @@ test/settings.py,sha256=vU1dqUvGzshi6MG7JbGfW4jKfUsfAObgUfky-LMjUNs,344
|
|
|
22
22
|
test/test_embedding.py,sha256=78M6t9tt6-oCfdQZfOartCIkUFZMvogcu5UKJh1lJb8,609
|
|
23
23
|
test/test_minio.py,sha256=TOkX8A2pPkjrwAIH88xBZmFpDc1ZgTk1QS6mtubOZ-Y,2308
|
|
24
24
|
test/test_vector.py,sha256=4sJ7bXt5iRhc6j1Ig0bZ1j0huPU-clnsnT7O0-uFbkw,1311
|
|
25
|
-
agentic_kit_common-0.0.
|
|
26
|
-
agentic_kit_common-0.0.
|
|
27
|
-
agentic_kit_common-0.0.
|
|
28
|
-
agentic_kit_common-0.0.
|
|
25
|
+
agentic_kit_common-0.0.7.dist-info/METADATA,sha256=X6qQnjNd1H3E1s5Lu0bnl5Ac-JzUaVFeG2WFrW1w47A,7496
|
|
26
|
+
agentic_kit_common-0.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
27
|
+
agentic_kit_common-0.0.7.dist-info/top_level.txt,sha256=nEKDlp84vqKSVWssGcxyuIsTqWLhMo45xqMs2GK4Dgg,24
|
|
28
|
+
agentic_kit_common-0.0.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|