This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
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

Fields

DateToTimeStampField

models.py:

class MyModel(models.Model):
    date = models.DateField()

serializers.py:

class MySerializer(serializers.ModelSerializer):

    date = DateToTimeStampField()

    class Meta:
        model = MyModel
        fields = ('id', 'date',)

The representation of the serializer is like this:

{
    'id': 1,
    'date': 1440626400000
}

But into the database stores ‘2015-08-27’

DateTimeToTimeStampField

models.py:

class MyModel(models.Model):
    date = models.DateTimeField()

serializers.py:

class MySerializer(serializers.ModelSerializer):

    date = DateTimeToTimeStampField()

    class Meta:
        model = MyModel
        fields = ('id', 'date',)

The representation of the serializer is like this:

{
    'id': 1,
    'date': 1440688376
}

But into the database stores ‘2015-08-27 15:12:56 UTC’

Release History

Release History

1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-rest-tools-1.1.tar.gz (3.5 kB) Copy SHA256 Checksum SHA256 Source Aug 27, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting