• Stars
    star
    215
  • Rank 183,925 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created about 8 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Django REST framework QueryFields

gh codecov 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": "[email protected]",
  "spirit_animal": "raccoon"
}

Supported Django versions: 1.7 - 3.2+. Check the CI matrix for details.

Documentation is hosted on Read The Docs.

Developers, developers, developers!

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

# 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

More Repositories

1

advent-of-code-data

Get your Advent of Code data with a single import statement
Python
514
star
2

johnnydep

Display dependency tree of Python distribution
Python
504
star
3

oyaml

Ordered YAML: drop-in replacement for PyYAML which preserves dict ordering
Python
170
star
4

resources-example

An example project demonstrating how to access data files in Python package
Python
81
star
5

pytest-structlog

Structured logging assertions
Python
55
star
6

advent-of-code-wim

Wim's solutions for https://adventofcode.com/ puzzles
Python
35
star
7

pycharm-dvorak-keymap

A keymap for working around the bugged modifier shortcuts in jetbrains IDEs
Python
17
star
8

pytest-custom-report

Configure the symbols displayed for test outcomes
Python
12
star
9

copyingmock

A subclass of MagicMock that copies the arguments
Python
6
star
10

advent-of-code-sample

Example package structure with entry-points for using advent-of-code-data runner
Python
5
star
11

pytest-raisin

Plugin enabling the use of exception instances with pytest.raises context 🍇
Python
4
star
12

monkey-magic

Monkeypatch built-in types
Python
3
star
13

aocd-example-parser

Default implementation of an example parser plugin for advent-of-code-data
Python
3
star
14

wimpy

Anti-copy-pasta
Python
3
star
15

setuptools-reproducible

Extension of setuptools to support reproducible builds
Python
2
star
16

userscripts

wim's tampermonkey scripts
JavaScript
2
star
17

all-escapes

Codec for binary escapes
Python
2
star
18

setuptools-ext

Extension of setuptools to support all core metadata fields
Python
2
star
19

readabledelta

Human readable modification of timedelta
Python
1
star