-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Single taxonomy view API for tags (#78)
- Loading branch information
Showing
17 changed files
with
953 additions
and
48 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
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
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,29 @@ | ||
from edx_rest_framework_extensions.paginators import DefaultPagination # type: ignore[import] | ||
|
||
# From this point, the tags begin to be paginated | ||
TAGS_THRESHOLD = 1000 | ||
|
||
# From this point, search tags begin to be paginated | ||
SEARCH_TAGS_THRESHOLD = 200 | ||
|
||
|
||
class TagsPagination(DefaultPagination): | ||
""" | ||
Custom pagination configuration for taxonomies | ||
with a large number of tags. Used on the get tags API view. | ||
""" | ||
page_size = 10 | ||
max_page_size = 300 | ||
|
||
|
||
class DisabledTagsPagination(DefaultPagination): | ||
""" | ||
Custom pagination configuration for taxonomies | ||
with a small number of tags. Used on the get tags API view | ||
This class allows to bring all the tags of the taxonomy. | ||
It should be used if the number of tags within | ||
the taxonomy does not exceed `TAGS_THRESHOLD`. | ||
""" | ||
page_size = TAGS_THRESHOLD | ||
max_page_size = TAGS_THRESHOLD + 1 |
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
Oops, something went wrong.