Tools for Django Rest Framework
Project description
Install last stable version from pypi
pip install django-rest-tools
Install development version
pip install https://github.com/quiqueporta/django-rest-tools/tarball/master
Filters
NearToPointFilter
views.py:
from django_rest_tools.filters import NearToPointFilter
class LocationsList(generics.ListAPIView):
queryset = Location.objects.all()
serializer_class = LocationListSerializer
filter_backends = (NearToPointFilter,)
point_field_filter = 'location'
We can then filter in the URL.
eg:. /location/?max_distance=40&lat=-40.4862&long=-0.39536
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.