mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
* module docstrings * db schema graph * dev docs first pass * dev docs pass 2 * add generated notification to top of generated docs files * linting * regen docs Co-authored-by: Stefan Pratter <stefan@20c.com> Co-authored-by: Sunshine Buchholz <sunshine@20c.com>
68 lines
1.1 KiB
Markdown
68 lines
1.1 KiB
Markdown
Generated from api_cache.py on 2021-10-15 07:56:57.376975
|
|
|
|
# peeringdb_server.api_cache
|
|
|
|
Handle loading of api-cache data.
|
|
|
|
# Classes
|
|
---
|
|
|
|
## APICacheLoader
|
|
|
|
```
|
|
APICacheLoader(builtins.object)
|
|
```
|
|
|
|
Checks if an API GET request qualifies for a cache load
|
|
and if it does allows you to provide the cached result.
|
|
|
|
|
|
### Methods
|
|
|
|
#### \__init__
|
|
`def __init__(self, viewset, qset, filters)`
|
|
|
|
Initialize self. See help(type(self)) for accurate signature.
|
|
|
|
---
|
|
#### filter_fields
|
|
`def filter_fields(self, row)`
|
|
|
|
Remove any unwanted fields from the resultset
|
|
according to the `fields` filter specified in the request.
|
|
|
|
---
|
|
#### load
|
|
`def load(self)`
|
|
|
|
Load the cached response according to tag and depth.
|
|
|
|
---
|
|
#### qualifies
|
|
`def qualifies(self)`
|
|
|
|
Check if request qualifies for a cache load.
|
|
|
|
---
|
|
|
|
## CacheRedirect
|
|
|
|
```
|
|
CacheRedirect(builtins.Exception)
|
|
```
|
|
|
|
Raise this error to redirect to cache response during viewset.get_queryset
|
|
or viewset.list()
|
|
|
|
Argument should be an APICacheLoader instance.
|
|
|
|
|
|
### Methods
|
|
|
|
#### \__init__
|
|
`def __init__(self, loader)`
|
|
|
|
Initialize self. See help(type(self)) for accurate signature.
|
|
|
|
---
|