-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs - add detail to custom backend and pagination
- Loading branch information
Alexander Darby
committed
May 23, 2022
1 parent
4f0ea10
commit d888bbd
Showing
3 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Custom Page Size | ||
========================= | ||
|
||
How to set pagination limits | ||
--------------------------------- | ||
|
||
To specify a pagination limit with medallion you should call ``set_config`` | ||
when creating your application. | ||
|
||
.. code-block:: python | ||
from medallion import application_instance, set_config | ||
set_config(application_instance, "taxii", {"taxii": {"max_page_size": 100}}) | ||
How to access the pagination limit | ||
------------------------------- | ||
|
||
From within your application, you can then access the configured pagination limit | ||
through the ``current_app`` object. | ||
|
||
.. code-block:: python | ||
from medallion import current_app | ||
page_size = current_app.taxii_config["max_page_size"] | ||