internal 1.1.35.2__py3-none-any.whl → 1.1.35.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 internal might be problematic. Click here for more details.
internal/model/base_model.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
+
from idlelib import query
|
|
2
3
|
|
|
3
4
|
from typing import List, Tuple, Union, Dict, Type, Optional, Any, Literal, Union, Set, Mapping
|
|
4
5
|
import typing_extensions
|
|
@@ -27,8 +28,7 @@ class InternalBaseDocument(Document):
|
|
|
27
28
|
@classmethod
|
|
28
29
|
async def get_pagination_list(cls, app: FastAPI, query: list = None, sort: List[Tuple] = None,
|
|
29
30
|
page_size: int = DEF_PAGE_SIZE, page_no: int = DEF_PAGE_NO,
|
|
30
|
-
ignore_cache: bool = False, fetch_links: bool = False,
|
|
31
|
-
exclude_fields: List[str] = None):
|
|
31
|
+
ignore_cache: bool = False, fetch_links: bool = False, exclude: Dict = None):
|
|
32
32
|
if not query:
|
|
33
33
|
final_query = []
|
|
34
34
|
else:
|
|
@@ -59,15 +59,11 @@ class InternalBaseDocument(Document):
|
|
|
59
59
|
else:
|
|
60
60
|
page_no = max(1, min(page_no, total_pages))
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
_query = cls.find(*final_query, ignore_cache=ignore_cache, fetch_links=fetch_links)
|
|
63
|
+
if exclude:
|
|
64
|
+
_query = _query.project(exclude)
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
if exclude_fields:
|
|
67
|
-
projection = {field: 0 for field in exclude_fields}
|
|
68
|
-
data_query = data_query.project(projection)
|
|
69
|
-
|
|
70
|
-
page_data = await data_query.sort(*final_sort).limit(page_size).skip((page_no - 1) * page_size).to_list()
|
|
66
|
+
page_data = await _query.sort(*final_sort).limit(page_size).skip((page_no - 1) * page_size).to_list()
|
|
71
67
|
|
|
72
68
|
return page_no, page_size, total_num, page_data
|
|
73
69
|
|
|
@@ -96,7 +92,7 @@ class InternalBaseDocument(Document):
|
|
|
96
92
|
|
|
97
93
|
@classmethod
|
|
98
94
|
async def get_list(cls, app: FastAPI, query: list = None, sort: List[Tuple] = None, ignore_cache: bool = False,
|
|
99
|
-
fetch_links: bool = False,
|
|
95
|
+
fetch_links: bool = False, exclude: Dict = None):
|
|
100
96
|
if not query:
|
|
101
97
|
final_query = []
|
|
102
98
|
else:
|
|
@@ -116,15 +112,12 @@ class InternalBaseDocument(Document):
|
|
|
116
112
|
continue
|
|
117
113
|
final_sort.append((cls.id, pymongo.ASCENDING))
|
|
118
114
|
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
_query = cls.find(*final_query, ignore_cache=ignore_cache, fetch_links=fetch_links)
|
|
116
|
+
if exclude:
|
|
117
|
+
_query = _query.project(exclude)
|
|
121
118
|
|
|
122
|
-
|
|
123
|
-
if exclude_fields:
|
|
124
|
-
projection = {field: 0 for field in exclude_fields}
|
|
125
|
-
query_obj = query_obj.project(projection)
|
|
119
|
+
data = await _query.sort(*final_sort).to_list()
|
|
126
120
|
|
|
127
|
-
data = await query_obj.sort(*final_sort).to_list()
|
|
128
121
|
return data
|
|
129
122
|
|
|
130
123
|
def model_dump(
|
|
@@ -31,10 +31,10 @@ internal/interface/base_interface.py,sha256=3YaVjIgLi_pZpLk5SEIk8WVkuICM8qPavT8r
|
|
|
31
31
|
internal/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
32
|
internal/middleware/log_request.py,sha256=OFwWnGfzXnllcQsBHolAWVsahXKoEhw3OQ1YWOm7RHM,2087
|
|
33
33
|
internal/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
|
-
internal/model/base_model.py,sha256=
|
|
34
|
+
internal/model/base_model.py,sha256=V21OUoLAzeTrYRPV4cUsyGCOaDcS-OpXC49SCiHjAkg,5707
|
|
35
35
|
internal/model/operate.py,sha256=QSM6yXYXpJMwrqkUGEWZLrEBaUgqHwVHY_Fi4S42hKc,3190
|
|
36
36
|
internal/utils.py,sha256=wK1QumW1AaWE1ga2-WcDH2rtXRr2hSLwXzy-iI5dTzY,3962
|
|
37
37
|
internal/validator_utils.py,sha256=CqjaVFoAu5MqvBG_AkTP-r7AliWawtUWB851USj4moI,1519
|
|
38
|
-
internal-1.1.35.
|
|
39
|
-
internal-1.1.35.
|
|
40
|
-
internal-1.1.35.
|
|
38
|
+
internal-1.1.35.3.dist-info/METADATA,sha256=zfu2VUwh7UVMML8jA7DVB3O0IRfq3XY98SMkdpImJSo,941
|
|
39
|
+
internal-1.1.35.3.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
|
|
40
|
+
internal-1.1.35.3.dist-info/RECORD,,
|
|
File without changes
|