drf-restricted-fields-0.0.1
توضیحات
Restrict fields returned by DRF serializers
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | drf-restricted-fields-0.0.1 |
| نام | drf-restricted-fields |
| نسخه کتابخانه | 0.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Tonye Jack |
| ایمیل نویسنده | jtonye@ymail.com |
| آدرس صفحه اصلی | https://github.com/tj-django/drf-restricted-fields |
| آدرس اینترنتی | https://pypi.org/project/drf-restricted-fields/ |
| مجوز | MIT license |
=====================
drf-restricted-fields
=====================
.. image:: https://img.shields.io/pypi/v/drf_restricted_fields.svg
:target: https://pypi.python.org/pypi/drf_restricted_fields
.. image:: https://github.com/tj-django/drf-restricted-fields/actions/workflows/test.yml/badge.svg
:target: https://github.com/tj-django/drf-restricted-fields/actions/workflows/test.yml
.. image:: https://readthedocs.org/projects/drf-restricted-fields/badge/?version=latest
:target: https://drf-restricted-fields.readthedocs.io/en/latest/?version=latest
:alt: Documentation Status
.. image:: https://pyup.io/repos/github/tj-django/drf-restricted-fields/shield.svg
:target: https://pyup.io/repos/github/tj-django/drf-restricted-fields/
:alt: Updates
Features
========
Restrict fields returned by DRF serializers using the ``only`` query parameter
------------------------------------------------------------------------------
.. code-block:: console
GET http://127.0.0.1:8000/api/users/?only=id&only=name
Serialize only the `id` and `name` fields.
.. code-block:: console
{
"count": 198,
"next": "http://127.0.0.1:8000/api/users/?only=id&only=name&page=1",
"previous": null,
"results":[
{
"id": 1,
"name": "Test"
},
...
],
}
Defer fields returned by DRF serializers using the ``defer`` query parameter
----------------------------------------------------------------------------
.. code-block:: console
GET http://127.0.0.1:8000/api/users/?defer=name&defer=age
Serialize only the `id` and `name` fields.
.. code-block:: console
{
"count": 198,
"next": "http://127.0.0.1:8000/api/users/?defer=name&defer=age&page=1",
"previous": null,
"results":[
{
"id": 1,
},
...
],
}
* Free software: MIT license
* Documentation: https://drf-restricted-fields.readthedocs.io.
نیازمندی
| مقدار | نام |
|---|---|
| - | django |
| - | djangorestframework |
| - | bump2version |
| - | readme-renderer[md] |
| - | changes |
| - | git-changelog |
| - | twine |
| - | wheel |
| - | django |
| - | djangorestframework |
| - | bump2version |
| - | readme-renderer[md] |
| - | changes |
| - | git-changelog |
| - | twine |
| - | wheel |
| >=3 | pytest |
| - | tox |
| - | tox-gh-actions |
| - | coverage |
| - | flake8 |
| - | yamllint |
| - | isort |
| - | black |
| - | black |
| - | watchdog[watchmedo] |
| - | Sphinx |
| - | flake8 |
| - | yamllint |
| - | isort |
| - | black |
| - | black |
| >=3 | pytest |
| - | tox |
| - | tox-gh-actions |
| - | coverage |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=2.6 | Python |
نحوه نصب
نصب پکیج whl drf-restricted-fields-0.0.1:
pip install drf-restricted-fields-0.0.1.whl
نصب پکیج tar.gz drf-restricted-fields-0.0.1:
pip install drf-restricted-fields-0.0.1.tar.gz