Skip to main content

Tools for Django Rest Framework

Project description

Build Status Coverage Status Requirements Status

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-rest-tools-1.0.1.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file django-rest-tools-1.0.1.tar.gz.

File metadata

File hashes

Hashes for django-rest-tools-1.0.1.tar.gz
Algorithm Hash digest
SHA256 886626cdbd6a1b03828f7812972d52ee9bdf91e99748f033fa9acc6a63283b6b
MD5 f3d83ecbf491aec881e1b57b516f708b
BLAKE2b-256 1dcf4eea19ec51810b238bf30382008b885642a4e5e76df0a493719a3c158fd0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page