This repository has been archived by the owner. It is now read-only.
Tastypie Redis Resource
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tastypie_redis
.gitignore
MANIFEST.in
README.rst
setup.py

README.rst

Redis Resource for Tastypie

Allows you to create delicious APIs for Redis.

Settings

REDIS_HOST = localhost
REDIS_PORT = 6379
REDIS_DATABASE = "database_name"

Example of Usage

from tastypie import fields
from tastypie.authorization import Authorization

from tastypie_redis.resources import RedisResource, Document

class DocumentResource(RedisResource):
    id = fields.CharField(attribute="_id")
    title = fields.CharField(attribute="title", null=True)
    entities = fields.ListField(attribute="entities", null=True)

    class Meta:
        resource_name = "documents"
        list_allowed_methods = ["delete", "get", "post"]
        authorization = Authorization()
        object_class = Document
        collection = "documents" # collection name