djangorestframework-queryfields


Namedjangorestframework-queryfields JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/wimglenn/djangorestframework-queryfields
SummarySerialize a partial subset of fields in the API
upload_time2023-11-22 02:53:58
maintainer
docs_urlhttps://pythonhosted.org/djangorestframework-queryfields/
authorWim Glenn
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Django REST framework QueryFields
=================================

|gh|_ |codecov|_ |pypi|_ |womm|_

.. |gh| image:: https://github.com/wimglenn/djangorestframework-queryfields/actions/workflows/main.yml/badge.svg
.. _gh: https://github.com/wimglenn/djangorestframework-queryfields/actions

.. |codecov| image:: https://codecov.io/gh/wimglenn/djangorestframework-queryfields/branch/main/graph/badge.svg?token=WeqbZ83YRg
.. _codecov: https://codecov.io/gh/wimglenn/djangorestframework-queryfields

.. |pypi| image:: https://img.shields.io/pypi/v/djangorestframework-queryfields.svg
.. _pypi: https://pypi.org/project/djangorestframework-queryfields

.. |womm| image:: https://cdn.rawgit.com/nikku/works-on-my-machine/v0.2.0/badge.svg
.. _womm: https://github.com/nikku/works-on-my-machine

Allows clients to control which fields will be sent in the API response.  Fields are specified in the query, e.g.

.. code-block:: 

    # You want a list of users but you're only interested in the fields "id" and "username":
    
    GET /users/?fields=id,username
    
    [
      {
        "id": 1,
        "username": "tom"
      },
      {
        "id": 2,
        "username": "wim"
      }
    ]

    
    # You want to see every field except "id" for the specific user wim:
    
    GET /users/2/?fields!=id
    
    {
      "username": "wim",
      "email": "hey@wimglenn.com",
      "spirit_animal": "raccoon"
    }

**Supported Django versions**: 1.7 - 3.2+.  Check the `CI matrix <https://github.com/wimglenn/djangorestframework-queryfields/blob/main/.github/workflows/main.yml/>`_ for details.

Documentation is hosted on `Read The Docs <http://djangorestframework-queryfields.readthedocs.io/>`_.

Developers, developers, developers!
-----------------------------------

Want to contribute to the project? This is how to run the test suite:

.. code-block:: bash

   # get the codez
   git clone https://github.com/wimglenn/djangorestframework-queryfields.git

   # create and/or activate your virtualenv, this or something like it:
   cd djangorestframework-queryfields
   python3 -m venv .venv
   source .venv/bin/activate

   # installing the app in your venv
   pip install --editable ".[dev]"
   git checkout -b myfeature

   # hack away, then ...
   pytest

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/wimglenn/djangorestframework-queryfields",
    "name": "djangorestframework-queryfields",
    "maintainer": "",
    "docs_url": "https://pythonhosted.org/djangorestframework-queryfields/",
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Wim Glenn",
    "author_email": "hey@wimglenn.com",
    "download_url": "https://files.pythonhosted.org/packages/b8/83/8c168b6169783c41c485068ef4a606e78461c09c4ee9a04fb986c6b83c41/djangorestframework-queryfields-1.1.0.tar.gz",
    "platform": null,
    "description": "Django REST framework QueryFields\n=================================\n\n|gh|_ |codecov|_ |pypi|_ |womm|_\n\n.. |gh| image:: https://github.com/wimglenn/djangorestframework-queryfields/actions/workflows/main.yml/badge.svg\n.. _gh: https://github.com/wimglenn/djangorestframework-queryfields/actions\n\n.. |codecov| image:: https://codecov.io/gh/wimglenn/djangorestframework-queryfields/branch/main/graph/badge.svg?token=WeqbZ83YRg\n.. _codecov: https://codecov.io/gh/wimglenn/djangorestframework-queryfields\n\n.. |pypi| image:: https://img.shields.io/pypi/v/djangorestframework-queryfields.svg\n.. _pypi: https://pypi.org/project/djangorestframework-queryfields\n\n.. |womm| image:: https://cdn.rawgit.com/nikku/works-on-my-machine/v0.2.0/badge.svg\n.. _womm: https://github.com/nikku/works-on-my-machine\n\nAllows clients to control which fields will be sent in the API response.  Fields are specified in the query, e.g.\n\n.. code-block:: \n\n    # You want a list of users but you're only interested in the fields \"id\" and \"username\":\n    \n    GET /users/?fields=id,username\n    \n    [\n      {\n        \"id\": 1,\n        \"username\": \"tom\"\n      },\n      {\n        \"id\": 2,\n        \"username\": \"wim\"\n      }\n    ]\n\n    \n    # You want to see every field except \"id\" for the specific user wim:\n    \n    GET /users/2/?fields!=id\n    \n    {\n      \"username\": \"wim\",\n      \"email\": \"hey@wimglenn.com\",\n      \"spirit_animal\": \"raccoon\"\n    }\n\n**Supported Django versions**: 1.7 - 3.2+.  Check the `CI matrix <https://github.com/wimglenn/djangorestframework-queryfields/blob/main/.github/workflows/main.yml/>`_ for details.\n\nDocumentation is hosted on `Read The Docs <http://djangorestframework-queryfields.readthedocs.io/>`_.\n\nDevelopers, developers, developers!\n-----------------------------------\n\nWant to contribute to the project? This is how to run the test suite:\n\n.. code-block:: bash\n\n   # get the codez\n   git clone https://github.com/wimglenn/djangorestframework-queryfields.git\n\n   # create and/or activate your virtualenv, this or something like it:\n   cd djangorestframework-queryfields\n   python3 -m venv .venv\n   source .venv/bin/activate\n\n   # installing the app in your venv\n   pip install --editable \".[dev]\"\n   git checkout -b myfeature\n\n   # hack away, then ...\n   pytest\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Serialize a partial subset of fields in the API",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/wimglenn/djangorestframework-queryfields"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "319c725493f7939ee5dc49f837b9655beb4f924c723ecc54d641539d15b47e4a",
                "md5": "ca19a914bb2d752b7f4a1929a1aab700",
                "sha256": "3952e02fd800de34a0fc64963bcaf7eb1e9ad688f120b1bca5b261843323f36e"
            },
            "downloads": -1,
            "filename": "djangorestframework_queryfields-1.1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ca19a914bb2d752b7f4a1929a1aab700",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 4404,
            "upload_time": "2023-11-22T02:53:57",
            "upload_time_iso_8601": "2023-11-22T02:53:57.321593Z",
            "url": "https://files.pythonhosted.org/packages/31/9c/725493f7939ee5dc49f837b9655beb4f924c723ecc54d641539d15b47e4a/djangorestframework_queryfields-1.1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b8838c168b6169783c41c485068ef4a606e78461c09c4ee9a04fb986c6b83c41",
                "md5": "2a795444c3233fb9e4014320d623ce19",
                "sha256": "512516947e2d0f7b132469bc3b96b702653ed032e450d90b6efc0dc7fe031ef7"
            },
            "downloads": -1,
            "filename": "djangorestframework-queryfields-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2a795444c3233fb9e4014320d623ce19",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5904,
            "upload_time": "2023-11-22T02:53:58",
            "upload_time_iso_8601": "2023-11-22T02:53:58.887379Z",
            "url": "https://files.pythonhosted.org/packages/b8/83/8c168b6169783c41c485068ef4a606e78461c09c4ee9a04fb986c6b83c41/djangorestframework-queryfields-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-22 02:53:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wimglenn",
    "github_project": "djangorestframework-queryfields",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "djangorestframework-queryfields"
}
        
Elapsed time: 0.14818s