Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add taxonomy api pagination #69

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions openedx_tagging/core/tagging/rest_api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
get_taxonomy,
get_taxonomies,
)
from .serializers import TaxonomyListQueryParamsSerializer, TaxonomySerializer
from .permissions import TaxonomyObjectPermissions
from .serializers import TaxonomyListQueryParamsSerializer, TaxonomySerializer


class TaxonomyView(ModelViewSet):
Expand All @@ -19,6 +19,8 @@ class TaxonomyView(ModelViewSet):

**List Query Parameters**
* enabled (optional) - Filter by enabled status. Valid values: true, false, 1, 0, "true", "false", "1"
* page (optional) - Page number (default: 1)
* page_size (optional) - Number of items per page (default: 10)

**List Example Requests**
GET api/tagging/v1/taxonomy - Get all taxonomies
Expand Down Expand Up @@ -59,7 +61,6 @@ class TaxonomyView(ModelViewSet):
"allow_free_text": True,
}


**Create Query Returns**
* 201 - Success
* 403 - Permission denied
Expand Down
7 changes: 7 additions & 0 deletions projects/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,10 @@
INTERNAL_IPS = [
"127.0.0.1",
]

######################### Django Rest Framework ########################

REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'edx_rest_framework_extensions.paginators.DefaultPagination',
'PAGE_SIZE': 10,
}
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
Django<5.0 # Web application framework

djangorestframework<4.0 # REST API
edx-drf-extensions # Extensions to the Django REST Framework used by Open edX

rules<4.0 # Django extension for rules-based authorization checks
68 changes: 68 additions & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,88 @@
#
asgiref==3.7.2
# via django
certifi==2023.7.22
# via requests
cffi==1.15.1
# via
# cryptography
# pynacl
charset-normalizer==3.2.0
# via requests
click==8.1.6
# via edx-django-utils
cryptography==41.0.3
# via pyjwt
django==3.2.19
# via
# -c requirements/constraints.txt
# -r requirements/base.in
# django-crum
# django-waffle
# djangorestframework
# drf-jwt
# edx-django-utils
# edx-drf-extensions
django-crum==0.7.9
# via edx-django-utils
django-waffle==4.0.0
# via
# edx-django-utils
# edx-drf-extensions
djangorestframework==3.14.0
# via
# -r requirements/base.in
# drf-jwt
# edx-drf-extensions
drf-jwt==1.19.2
# via edx-drf-extensions
edx-django-utils==5.7.0
# via edx-drf-extensions
edx-drf-extensions==8.8.0
# via -r requirements/base.in
edx-opaque-keys==2.4.0
# via edx-drf-extensions
idna==3.4
# via requests
newrelic==8.9.0
# via edx-django-utils
pbr==5.11.1
# via stevedore
psutil==5.9.5
# via edx-django-utils
pycparser==2.21
# via cffi
pyjwt[crypto]==2.8.0
# via
# drf-jwt
# edx-drf-extensions
pymongo==3.13.0
# via edx-opaque-keys
pynacl==1.5.0
# via edx-django-utils
python-dateutil==2.8.2
# via edx-drf-extensions
pytz==2023.3
# via
# django
# djangorestframework
requests==2.31.0
# via edx-drf-extensions
rules==3.3
# via -r requirements/base.in
semantic-version==2.10.0
# via edx-drf-extensions
six==1.16.0
# via
# edx-drf-extensions
# python-dateutil
sqlparse==0.4.4
# via django
stevedore==5.1.0
# via
# edx-django-utils
# edx-opaque-keys
typing-extensions==4.6.3
# via asgiref
urllib3==2.0.4
# via requests
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# make upgrade
#
click==8.1.3
click==8.1.6
# via import-linter
distlib==0.3.6
# via virtualenv
Expand Down
80 changes: 74 additions & 6 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,29 @@ build==0.10.0
# via
# -r requirements/pip-tools.txt
# pip-tools
certifi==2023.5.7
certifi==2023.7.22
# via
# -r requirements/quality.txt
# requests
cffi==1.15.1
# via
# -r requirements/quality.txt
# cryptography
# pynacl
chardet==5.1.0
# via diff-cover
charset-normalizer==3.1.0
charset-normalizer==3.2.0
# via
# -r requirements/quality.txt
# requests
click==8.1.3
click==8.1.6
# via
# -r requirements/ci.txt
# -r requirements/pip-tools.txt
# -r requirements/quality.txt
# click-log
# code-annotations
# edx-django-utils
# edx-lint
# import-linter
# pip-tools
Expand All @@ -57,9 +59,10 @@ coverage[toml]==7.2.7
# via
# -r requirements/quality.txt
# pytest-cov
cryptography==41.0.1
cryptography==41.0.3
# via
# -r requirements/quality.txt
# pyjwt
# secretstorage
ddt==1.6.0
# via -r requirements/quality.txt
Expand All @@ -77,23 +80,54 @@ django==3.2.19
# via
# -c requirements/constraints.txt
# -r requirements/quality.txt
# django-crum
# django-debug-toolbar
# django-waffle
# djangorestframework
# drf-jwt
# edx-django-utils
# edx-drf-extensions
# edx-i18n-tools
django-crum==0.7.9
# via
# -r requirements/quality.txt
# edx-django-utils
django-debug-toolbar==4.1.0
# via
# -r requirements/dev.in
# -r requirements/quality.txt
django-waffle==4.0.0
# via
# -r requirements/quality.txt
# edx-django-utils
# edx-drf-extensions
djangorestframework==3.14.0
# via -r requirements/quality.txt
# via
# -r requirements/quality.txt
# drf-jwt
# edx-drf-extensions
docutils==0.20.1
# via
# -r requirements/quality.txt
# readme-renderer
drf-jwt==1.19.2
# via
# -r requirements/quality.txt
# edx-drf-extensions
edx-django-utils==5.7.0
# via
# -r requirements/quality.txt
# edx-drf-extensions
edx-drf-extensions==8.8.0
# via -r requirements/quality.txt
edx-i18n-tools==0.9.2
# via -r requirements/dev.in
edx-lint==5.3.4
# via -r requirements/quality.txt
edx-opaque-keys==2.4.0
# via
# -r requirements/quality.txt
# edx-drf-extensions
exceptiongroup==1.1.1
# via
# -r requirements/quality.txt
Expand Down Expand Up @@ -179,6 +213,10 @@ more-itertools==9.1.0
# jaraco-classes
mysqlclient==2.1.1
# via -r requirements/quality.txt
newrelic==8.9.0
# via
# -r requirements/quality.txt
# edx-django-utils
packaging==23.1
# via
# -r requirements/ci.txt
Expand Down Expand Up @@ -214,6 +252,10 @@ pluggy==1.0.0
# tox
polib==1.2.0
# via edx-i18n-tools
psutil==5.9.5
# via
# -r requirements/quality.txt
# edx-django-utils
py==1.11.0
# via
# -r requirements/ci.txt
Expand All @@ -232,6 +274,11 @@ pygments==2.15.1
# diff-cover
# readme-renderer
# rich
pyjwt[crypto]==2.8.0
# via
# -r requirements/quality.txt
# drf-jwt
# edx-drf-extensions
pylint==2.17.4
# via
# -r requirements/quality.txt
Expand All @@ -252,6 +299,14 @@ pylint-plugin-utils==0.8.2
# -r requirements/quality.txt
# pylint-celery
# pylint-django
pymongo==3.13.0
# via
# -r requirements/quality.txt
# edx-opaque-keys
pynacl==1.5.0
# via
# -r requirements/quality.txt
# edx-django-utils
pyproject-hooks==1.0.0
# via
# -r requirements/pip-tools.txt
Expand All @@ -265,6 +320,10 @@ pytest-cov==4.1.0
# via -r requirements/quality.txt
pytest-django==4.5.2
# via -r requirements/quality.txt
python-dateutil==2.8.2
# via
# -r requirements/quality.txt
# edx-drf-extensions
python-slugify==8.0.1
# via
# -r requirements/quality.txt
Expand All @@ -286,6 +345,7 @@ readme-renderer==40.0
requests==2.31.0
# via
# -r requirements/quality.txt
# edx-drf-extensions
# requests-toolbelt
# twine
requests-toolbelt==1.0.0
Expand All @@ -306,12 +366,18 @@ secretstorage==3.3.3
# via
# -r requirements/quality.txt
# keyring
semantic-version==2.10.0
# via
# -r requirements/quality.txt
# edx-drf-extensions
six==1.16.0
# via
# -r requirements/ci.txt
# -r requirements/quality.txt
# bleach
# edx-drf-extensions
# edx-lint
# python-dateutil
# tox
snowballstemmer==2.2.0
# via
Expand All @@ -326,6 +392,8 @@ stevedore==5.1.0
# via
# -r requirements/quality.txt
# code-annotations
# edx-django-utils
# edx-opaque-keys
text-unidecode==1.3
# via
# -r requirements/quality.txt
Expand Down Expand Up @@ -365,7 +433,7 @@ typing-extensions==4.6.3
# import-linter
# pylint
# rich
urllib3==2.0.3
urllib3==2.0.4
# via
# -r requirements/quality.txt
# requests
Expand Down
Loading
Loading