Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(0)  |  Derive(5)  |  Import(3)
:class:`ModelResource` inherits all of the :class:`Meta` options of :class:`PresstResource`, however
with slightly different behavior and including some additions.

=====================  ==============================================================================
Attribute name         Description
=====================  ==============================================================================
model                  The :class:`sqlalchemy.ext.declarative.declarative_base` model this resource
                       maps to.
                       Tested only with `Flask-SQLAlchemy` models.
resource_name          Now defaults to the lower-case of the model class name.(more...)

src/f/l/Flask-Presst-0.2.10/examples/quickstart_api_resource_method.py   Flask-Presst(Download)
import datetime
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.orm import backref
from flask.ext.presst import PresstApi, ModelResource, Relationship, fields, resource_method
class BookResource(ModelResource):
    author = fields.ToOne('author', embedded=True)
 
    @resource_method('GET', collection=True)
    def published_after(self, books, year):
class AuthorResource(ModelResource):
    books = Relationship(BookResource)
 
    class Meta:
        model = Author

src/f/l/Flask-Presst-0.2.10/examples/quickstart_api_relationship.py   Flask-Presst(Download)
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.orm import backref
from flask.ext.presst import PresstApi, ModelResource, Relationship, fields
 
class BookResource(ModelResource):
    author = fields.ToOne('author', embedded=True)
 
    class Meta:
        model = Book
 
 
class AuthorResource(ModelResource):

src/f/l/Flask-Presst-0.2.10/examples/quickstart_api_simple.py   Flask-Presst(Download)
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.presst import PresstApi, ModelResource
 
app = Flask(__name__)
class BookResource(ModelResource):
    class Meta:
        model = Book
 
api = PresstApi(app)