Filter backend for DjangoRestFramework able to parse url parameters
Supports drf 3.5.x, 3.6.x, 3.7.x, 3.8.x Django 1.10.x, 1.11.x, 2.0.x, python 2.7, 3.6
Documentation
The full documentation is at https://drf-querystringfilter.readthedocs.org.
Basic Usage
class UserSerializer(ModelSerializer):
class Meta:
model = User
exclude = ()
class Users(ListAPIView):
serializer_class = UserSerializer
filter_fields = ['username', 'email', 'is_staff', 'date_joined']
filter_blacklist = None
filter_backends = (QueryStringFilterBackend,)
queryset = User.objects.all()
now you can query using…
- /users/?username=sax
- /users/?username__startswith=sa&date_joined__year=2000
- /users/?email__contains=@gmail.com
- /users/?is_staff=true
Links
Stable |
|||||
Development |
|||||
Project home page: |
|||||
Issue tracker: |
|||||
Download: |
|||||
Documentation: |
|||||
1.0
First stable release
0.7.0
abstract query_params habdling
handle multple values in query string
BACKWARD INCOMPATIBLE: __in now accept raw values and can appear multiple times
new operators __inlist and __not_inlist to be used for backward compatibility with __in and __not_in
0.6.0
Add handling of format query param
0.5.0 18/06/2018
add support for django 2.0
add query_params property to allow handling POST request
0.4.0 29/05/2017
add ‘__inarray’ and ‘__int_inarray’ lookup to handle json/arrays lookup both str/int
0.3.0 10/10/16
add ‘_distinct’ parameter to enable ‘.distinct()’ queries
0.2.0 19/09/16
add ‘ignore_filter’ to ignore querystring arguments
0.1.0 11/09/16
First release on PyPI.
Release files for drf-querystringfilter 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| drf-querystringfilter-1.0.0.tar.gz | 10.4 kB | Details |
Release files / drf-querystringfilter-1.0.0.tar.gz
| Download URL | drf-querystringfilter-1.0.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
feae3c659ae24cf393a35cf3161e87f01a71b8d30bb2cdf90e1eb549ba23af4c
|
|
BLAKE2b-256 checksum How to use checksums |
8c4a445ab7674f80b8b05e46c6ceffa7ea5b6b95c27b76915b1f8722c4bb4c5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |