Skip to main content

sorl-thumbnail support for Django Tastypie

Project description

Code Climate https://travis-ci.org/tomi77/tastypie-sorl-thumbnail.svg?branch=master https://coveralls.io/repos/github/tomi77/tastypie-sorl-thumbnail/badge.svg?branch=master

Installation

Install package via pip

pip install django-tastypie-sorl-thumbnail

Usage

from tastypie.authentication import Authentication
from tastypie.authorization import Authorization
from tastypie.resources import ModelResource
from tastypie_sorl_thumbnail.fields import ThumbnailField

from .models import Photo


class PhotoResource(ModelResource):
    thumbnail = ThumbnailField('photo', '120', quality=80)

    class Meta(object):
        queryset = Photo.objects.all()
        resource_name = 'photo'
        authentication = Authentication()
        authorization = Authorization()

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-tastypie-sorl-thumbnail-0.1.1.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

django_tastypie_sorl_thumbnail-0.1.1-py2.py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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