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

@@ -50,9 +50,15 @@ class InternalBaseDocument(Document):
50
50
 
51
51
  total_num = await cls.find(*final_query, ignore_cache=ignore_cache, fetch_links=fetch_links).sort(
52
52
  *final_sort).count()
53
- if total_num == 0:
53
+
54
+ total_pages = (total_num + page_size - 1) // page_size
55
+
56
+ if total_pages == 0:
57
+ page_no = 1
54
58
  page_data = []
55
59
  else:
60
+ page_no = max(1, min(page_no, total_pages))
61
+
56
62
  page_data = await cls.find(*final_query, ignore_cache=ignore_cache, fetch_links=fetch_links).sort(
57
63
  *final_sort).limit(page_size).skip((page_no - 1) * page_size).to_list()
58
64
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: internal
3
- Version: 1.1.4
3
+ Version: 1.1.5
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -30,10 +30,10 @@ internal/interface/base_interface.py,sha256=3YaVjIgLi_pZpLk5SEIk8WVkuICM8qPavT8r
30
30
  internal/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  internal/middleware/log_request.py,sha256=01UeoCsjv38U0kZQwRqEspSbEUJDCb-WUN1TPrSAz7Y,1491
32
32
  internal/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
- internal/model/base_model.py,sha256=NWjysNOp2MfXvAHGFqaQA_l8ZfTFvJbXQPUPuOXN_2g,5361
33
+ internal/model/base_model.py,sha256=hxleV8fYNvFgUoYmCv_inEP3kA4tD4HhCBCNFVK8SZg,5509
34
34
  internal/model/operate.py,sha256=QSM6yXYXpJMwrqkUGEWZLrEBaUgqHwVHY_Fi4S42hKc,3190
35
35
  internal/utils.py,sha256=i6YZdiXsiWnOjRdlJ6afNCGpyMe3Uo9mhm3xlQBy3Ls,2824
36
36
  internal/validator_utils.py,sha256=CqjaVFoAu5MqvBG_AkTP-r7AliWawtUWB851USj4moI,1519
37
- internal-1.1.4.dist-info/METADATA,sha256=yQQ60xY-YvvSCA3eqHH1Y4FzRJyYyDg_GzFzPprn2mU,938
38
- internal-1.1.4.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
39
- internal-1.1.4.dist-info/RECORD,,
37
+ internal-1.1.5.dist-info/METADATA,sha256=YRtNqS8TKkAREgS6YAVQENd-FCUzEouFZHX78XGjo9k,938
38
+ internal-1.1.5.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
39
+ internal-1.1.5.dist-info/RECORD,,