Skip to content

Query params

Capy Serializers supports automatic filtering from query params out of the box, this fields are limited from filters attribute and inherit the filters from its children.

Operations

Greater than

GET /api/v1/users?age>18

Less than

GET /api/v1/users?age<18

Greater than or equal to

GET /api/v1/users?age>=18

Less than or equal to

GET /api/v1/users?age<=18

Equal to

GET /api/v1/users?age=18

Insensitive equal to

GET /api/v1/users?name~=john

In

GET /api/v1/users?age=18,20,22

Django Lookup

The supported filters are exact, iexact, contains, icontains, gt, gte, lt, lte, in, startswith, istartswith, endswith, iendswith, range, year, month, day, hour, minute, second, isnull, search.

GET /api/v1/users?age[in]=18,20,22

Not

This operator is able to negate all the supported operations previously mentioned, the ! operator must be prefixed to the operation.

GET /api/v1/users?age!=18