Allows clients to control which fields will be sent in the API response
Clone or download
Latest commit 93419bc Aug 15, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs fix link for django-filter drf guide Jan 26, 2017
drf_queryfields v1.0.0 initial release Oct 19, 2016
tests use the cached property Nov 26, 2016
.travis.yml Include Python 3.7 / Django 2.1 in CI (#19) Aug 16, 2018
LICENSE add MIT license Oct 19, 2016
MANIFEST.in test deps Oct 20, 2016
README.rst Update README.rst Aug 16, 2018
setup.cfg Test Django 2.0 supported (#15) Feb 19, 2018
setup.py add coverage Nov 17, 2016
test_settings.py v1.0.0 initial release Oct 19, 2016

README.rst

Django REST framework QueryFields

travis coveralls pypi womm

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

# 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 - 2.1+. Check the CI matrix for details.

Documentation is hosted on Read The Docs.