Releases: manjitkumar/drf-url-filters
Releases · manjitkumar/drf-url-filters
[PATCH] fix usage of metaclass
usage of metaclass using six to keep it compatible with python 2 and 3
drf-url-filters-v0.5.0
Add support for Multi-valued (delimiter separated) validators.
drf-url-filters-v0.4.0
- Add support for value transformations.
- Remove the need for overriding
get_queryset()
for drf-url-filters to work. - Validation code refactor.
drf-url-filters-v0.3.0
drf-url-filters now supports python3
drf-url-filters-v0.2.0
Support for excluding querysets based upon .exclude()
method of queryset by adding a mapping key with a prefix ~
i.e ~update_ts__gte
and passing the same query param in url will exclude the results for given condition.
def get_queryset(self):
"""
Optionally restricts the queryset by filtering against
query parameters in the URL.
"""
query_params = self.request.query_params
url_params = self.kwargs
# get queryset_filters from FilterMixin
queryset_filters = self.get_db_filters(url_params, query_params)
# This dict will hold filter kwargs to pass in to Django ORM calls.
db_filters = queryset_filters['db_filters']
# This dict will hold exclude kwargs to pass in to Django ORM calls.
db_excludes = queryset_filters['db_excludes']
# fetch queryset from Players model
queryset = Player.objects.prefetch_related(
'teams' # use prefetch_related to minimize db hits.
).all()
return queryset.filter(**db_filters).exclude(**db_excludes)
drf-url-filters-v0.1.4
Fixed the return value for CSVofIntegers to be (uniform) list of integers.
i.e
5 => [5]
'3,4,5,6' => [3, 4, 5, 6]
'4' = > [4]
drf-url-filters-v0.1.3
Fixed absolute dependancies mentioned in install_requires
in setup.py
.
drf-url-filters-v0.1.2
Introduced drf-url-filter mixin with validations on query params using voluptuous.