diff options
author | Lorenz Diener <[email protected]> | 2018-06-04 16:48:20 +0200 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2018-06-04 16:48:20 +0200 |
commit | 163fd5d3d558eed452c642248cb69dc597a5765f (patch) | |
tree | 3f1e416fd46d86608565e0c87ab2730179b1e3ff /docs | |
parent | 093c207292f221a426a04181f6d158cba14bbe8a (diff) | |
download | mastodon.py-163fd5d3d558eed452c642248cb69dc597a5765f.tar.gz |
Move pagination info to attributes
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.rst | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/docs/index.rst b/docs/index.rst index 32d928f..a883e67 100644 --- a/docs/index.rst +++ b/docs/index.rst | |||
@@ -102,7 +102,12 @@ instance may choose to return less results than you requested. | |||
102 | The responses returned by paginated endpoints contain a "link" header that specifies | 102 | The responses returned by paginated endpoints contain a "link" header that specifies |
103 | which parameters to use to get the next and previous pages. Mastodon.py parses these | 103 | which parameters to use to get the next and previous pages. Mastodon.py parses these |
104 | and stores them (if present) in the first (for the previous page) and last (for the | 104 | and stores them (if present) in the first (for the previous page) and last (for the |
105 | next page) item of the returned list as _pagination_prev and _pagination_next. | 105 | next page) item of the returned list as _pagination_prev and _pagination_next. They |
106 | are accessible only via attribute-style access, and are not considered in determining | ||
107 | dict equality (meaning their presence will not affect any tests of wheter two dicts | ||
108 | are the same, or whether a specific dict is in a list). Note that this also means that | ||
109 | if you want to persist pagination info with your data, you'll have to take care of that | ||
110 | manually (or persist objects, not just dicts). | ||
106 | 111 | ||
107 | There are convenience functions available for fetching the previous and next page of | 112 | There are convenience functions available for fetching the previous and next page of |
108 | a paginated request as well as for fetching all pages starting from a first page. | 113 | a paginated request as well as for fetching all pages starting from a first page. |
@@ -188,7 +193,8 @@ you can also just write | |||
188 | 193 | ||
189 | description = mastodon.account_verify_credentials().source.note | 194 | description = mastodon.account_verify_credentials().source.note |
190 | 195 | ||
191 | and everything will work as intended. | 196 | and everything will work as intended. The class used for this is exposed as |
197 | `AttribAccessDict`. | ||
192 | 198 | ||
193 | 199 | ||
194 | User dicts | 200 | User dicts |