Tastypie MongoDB Resource
Project description
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
Ferrix Hovi (<https://github.com/ferrix>)
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
Hashes for tastypie-mongodb-resource-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c43546f9630e7ec341380064ebc7abb244e00a9eb94f063f28ec7888a0d04863 |
|
MD5 | c33c4275c3b0a3d60867ea73f98afe96 |
|
BLAKE2b-256 | 67f12e3d0dbbb0aee74f083a720abb87a5f40004086a0fb5706b1b34f506a310 |