internal 1.0.80__py3-none-any.whl → 1.0.81__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.

@@ -74,3 +74,30 @@ class InternalBaseDocument(Document):
74
74
 
75
75
  await self.save()
76
76
  return operate, original_model, self
77
+
78
+ @classmethod
79
+ async def get_list(cls, app: FastAPI, query: list = None, sort: List[Tuple] = None, ignore_cache: bool = False,
80
+ fetch_links: bool = False):
81
+ if not query:
82
+ final_query = []
83
+ else:
84
+ final_query = query
85
+
86
+ if not sort:
87
+ final_sort = [(cls.id, pymongo.ASCENDING)]
88
+ else:
89
+ final_sort = []
90
+ for temp_sort in sort:
91
+ if temp_sort[1] == OrderTypeEnum.ASC:
92
+ final_sort.append((temp_sort[0], pymongo.ASCENDING))
93
+ elif temp_sort[1] == OrderTypeEnum.DESC:
94
+ final_sort.append((temp_sort[0], pymongo.DESCENDING))
95
+ else:
96
+ print(f"order type value error: temp_sort:{temp_sort}")
97
+ continue
98
+ final_sort.append((cls.id, pymongo.ASCENDING))
99
+
100
+ data = await cls.find(*final_query, ignore_cache=ignore_cache, fetch_links=fetch_links).sort(
101
+ *final_sort).to_list()
102
+
103
+ return pdata
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: internal
3
- Version: 1.0.80
3
+ Version: 1.0.81
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -29,10 +29,10 @@ internal/interface/base_interface.py,sha256=3YaVjIgLi_pZpLk5SEIk8WVkuICM8qPavT8r
29
29
  internal/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  internal/middleware/log_request.py,sha256=bXAxmvvsYDhObXzfUw4ZNreKAWOo8ee_vpb6Xin5ztc,854
31
31
  internal/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
- internal/model/base_model.py,sha256=NS_GZvw_IqU1aZPHPpyQs6A741O34ybmzVzBPm9nGWU,3014
32
+ internal/model/base_model.py,sha256=AbyLdAwea6LUmF9hkMCUT2tkYOJVLRCud1m2THgDlrM,4054
33
33
  internal/model/operate.py,sha256=QSM6yXYXpJMwrqkUGEWZLrEBaUgqHwVHY_Fi4S42hKc,3190
34
34
  internal/utils.py,sha256=CXYZs4rDDe33Zac27YeknBE4uQN437ys1YAbW3Xeyow,1517
35
35
  internal/validator_utils.py,sha256=5ZLcNIgw1hvkYOj1f6gS9AYxe7Y3ufW9FyDxUS7FsMQ,1226
36
- internal-1.0.80.dist-info/METADATA,sha256=NzRWDK17ULlGfSMzTSmlPQMyyRlAK3e9h00se_zm7q4,663
37
- internal-1.0.80.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
38
- internal-1.0.80.dist-info/RECORD,,
36
+ internal-1.0.81.dist-info/METADATA,sha256=WwFaTCxZZ2e1FN-SCLuZ1t1SGk5p4JE2egxxV718X9w,663
37
+ internal-1.0.81.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
38
+ internal-1.0.81.dist-info/RECORD,,