internal 1.1.35.1__tar.gz → 1.1.35.3__tar.gz
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-1.1.35.1 → internal-1.1.35.3}/PKG-INFO +1 -1
- {internal-1.1.35.1 → internal-1.1.35.3}/pyproject.toml +1 -1
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/model/base_model.py +12 -16
- {internal-1.1.35.1 → internal-1.1.35.3}/README.md +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/__init__.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/base_config.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/base_factory.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/cache_redis.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/common_enum/__init__.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/common_enum/car_relation_type.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/common_enum/description_type.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/common_enum/device_code.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/common_enum/event_code.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/common_enum/lpr_direction.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/common_enum/notify_type.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/common_enum/operator_type.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/common_enum/order_type.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/common_enum/point_type.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/common_enum/websocket_channel.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/const.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/database.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/exception/__init__.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/exception/app_exception.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/exception/base_exception.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/exception/internal_exception.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/ext/__init__.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/ext/amazon/__init__.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/ext/amazon/aws/__init__.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/ext/amazon/aws/const.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/http/__init__.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/http/requests.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/http/responses.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/interface/__init__.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/interface/base_interface.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/middleware/__init__.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/middleware/log_request.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/model/__init__.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/model/operate.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/utils.py +0 -0
- {internal-1.1.35.1 → internal-1.1.35.3}/src/internal/validator_utils.py +0 -0
|
@@ -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:
|
|
@@ -48,10 +48,6 @@ class InternalBaseDocument(Document):
|
|
|
48
48
|
continue
|
|
49
49
|
final_sort.append((cls.id, pymongo.ASCENDING))
|
|
50
50
|
|
|
51
|
-
pymongo_kwargs = {}
|
|
52
|
-
if exclude_fields:
|
|
53
|
-
pymongo_kwargs['projection'] = {field: 0 for field in exclude_fields}
|
|
54
|
-
|
|
55
51
|
total_num = await cls.find(*final_query, ignore_cache=ignore_cache, fetch_links=fetch_links).sort(
|
|
56
52
|
*final_sort).count()
|
|
57
53
|
|
|
@@ -63,9 +59,11 @@ class InternalBaseDocument(Document):
|
|
|
63
59
|
else:
|
|
64
60
|
page_no = max(1, min(page_no, total_pages))
|
|
65
61
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
_query = cls.find(*final_query, ignore_cache=ignore_cache, fetch_links=fetch_links)
|
|
63
|
+
if exclude:
|
|
64
|
+
_query = _query.project(exclude)
|
|
65
|
+
|
|
66
|
+
page_data = await _query.sort(*final_sort).limit(page_size).skip((page_no - 1) * page_size).to_list()
|
|
69
67
|
|
|
70
68
|
return page_no, page_size, total_num, page_data
|
|
71
69
|
|
|
@@ -94,7 +92,7 @@ class InternalBaseDocument(Document):
|
|
|
94
92
|
|
|
95
93
|
@classmethod
|
|
96
94
|
async def get_list(cls, app: FastAPI, query: list = None, sort: List[Tuple] = None, ignore_cache: bool = False,
|
|
97
|
-
fetch_links: bool = False,
|
|
95
|
+
fetch_links: bool = False, exclude: Dict = None):
|
|
98
96
|
if not query:
|
|
99
97
|
final_query = []
|
|
100
98
|
else:
|
|
@@ -114,13 +112,11 @@ class InternalBaseDocument(Document):
|
|
|
114
112
|
continue
|
|
115
113
|
final_sort.append((cls.id, pymongo.ASCENDING))
|
|
116
114
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
pymongo_kwargs['projection'] = {field: 0 for field in exclude_fields}
|
|
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
|
-
data = await
|
|
123
|
-
**pymongo_kwargs).sort(*final_sort).to_list()
|
|
119
|
+
data = await _query.sort(*final_sort).to_list()
|
|
124
120
|
|
|
125
121
|
return data
|
|
126
122
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|