Skip to content

caleb-harrelson/djangorestframework-queryfields

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Allows clients to control which fields will be sent in the API response

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%