usage of metaclass using six to keep it compatible with python 2 and 3
0.5.0
Add support for Multi-valued (delimiter separated) validators.
0.4.0
- Add support for value transformations. - Remove the need for overriding `get_queryset()` for drf-url-filters to work. - Validation code refactor.
0.3.0
drf-url-filters now supports python3
0.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.
python 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()