Skip to content

Releases: manjitkumar/drf-url-filters

[PATCH] fix usage of metaclass

20 Jun 08:48
Compare
Choose a tag to compare

usage of metaclass using six to keep it compatible with python 2 and 3

drf-url-filters-v0.5.0

11 May 12:00
Compare
Choose a tag to compare

Add support for Multi-valued (delimiter separated) validators.

drf-url-filters-v0.4.0

08 May 07:09
Compare
Choose a tag to compare
  • 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

02 May 17:10
Compare
Choose a tag to compare

drf-url-filters now supports python3

drf-url-filters-v0.2.0

21 Sep 11:39
Compare
Choose a tag to compare

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

27 Jun 05:19
Compare
Choose a tag to compare

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

24 Apr 09:14
Compare
Choose a tag to compare

Fixed absolute dependancies mentioned in install_requires in setup.py.

drf-url-filters-v0.1.2

12 Apr 14:28
Compare
Choose a tag to compare

Introduced drf-url-filter mixin with validations on query params using voluptuous.