File tree Expand file tree Collapse file tree 4 files changed +6
-0
lines changed Expand file tree Collapse file tree 4 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ Changelog
7
7
### Added
8
8
9
9
- added the ` test() ` method to the webhook client
10
+ - added support for indicating the pagination direction in the ` ListPage ` objects
10
11
11
12
[ 0.2.0] ( ../../releases/tag/v0.2.0 ) - 2021-08-09
12
13
-----------------------------------------------
Original file line number Diff line number Diff line change @@ -2838,6 +2838,7 @@ Name | Type | Description
2838
2838
` limit ` | ` int ` | The offset of the first object specified in the API call
2839
2839
` count ` | ` int ` | Count of the returned objects on this page
2840
2840
` total ` | ` int ` | Total number of objects matching the API call criteria
2841
+ ` desc ` | ` bool ` | Whether the listing is descending or not
2841
2842
2842
2843
***
2843
2844
Original file line number Diff line number Diff line change @@ -216,6 +216,8 @@ class ListPage:
216
216
limit : int
217
217
#: int: Total number of objects matching the API call criteria
218
218
total : int
219
+ #: bool: Whether the listing is descending or not
220
+ desc : bool
219
221
220
222
def __init__ (self , data : Dict ) -> None :
221
223
"""Initialize a ListPage instance from the API response data."""
@@ -224,3 +226,4 @@ def __init__(self, data: Dict) -> None:
224
226
self .limit = data ['limit' ] if 'limit' in data else 0
225
227
self .count = data ['count' ] if 'count' in data else len (self .items )
226
228
self .total = data ['total' ] if 'total' in data else self .offset + self .count
229
+ self .desc = data ['desc' ] if 'desc' in data else False
Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ def list_items(
116
116
'offset' : int (response .headers ['x-apify-pagination-offset' ]),
117
117
'count' : len (data ), # because x-apify-pagination-count returns invalid values when hidden/empty items are skipped
118
118
'limit' : int (response .headers ['x-apify-pagination-limit' ]), # API returns 999999999999 when no limit is used
119
+ 'desc' : bool (response .headers ['x-apify-pagination-desc' ]),
119
120
})
120
121
121
122
def iterate_items (
You can’t perform that action at this time.
0 commit comments