Skip to main content

Tastypie MongoDB Resource

Project description

MongoDB Resource for Tastypie

Allows you to create delicious APIs for MongoDB.

Settings

MONGODB_HOST = None
MONGODB_PORT = None
MONGODB_DATABASE = "database_name"

# optional:
MONGODB_USERNAME = None
MONGODB_PASSWORD = None

Example of Usage

from tastypie import fields
from tastypie.authorization import Authorization

from tastypie_mongodb.resources import MongoDBResource, Document

class DocumentResource(MongoDBResource):

    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

Contributors

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

tastypie-mongodb-resource-0.0.8.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file tastypie-mongodb-resource-0.0.8.tar.gz.

File metadata

File hashes

Hashes for tastypie-mongodb-resource-0.0.8.tar.gz
Algorithm Hash digest
SHA256 de0cbc8d01cee8347d3995a95f18d24972b0eceb93f7c0d9baced6aba30dabfa
MD5 be85676e545b5f51f7d5e63d624b1dd0
BLAKE2b-256 eb0874cf1a8dfc012a1e3930ffcbc9d4295093c2f5742f765b0808b90248f3fe

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