RESTful 框架 Flask-Potion
- 授权协议: BSD
- 开发语言: Python
- 操作系统: 跨平台
- 软件首页: https://github.com/biosustain/potion
- 软件文档: http://potion.readthedocs.org/en/latest/
软件介绍
Flask-Potion 是一个强大的扩展用来构建 RESTful JSON APIs。特性包括:数据校验、模型资源、路由、关联、对象权限、过滤、排序、分页、信号和自动化 API schema 生成。Potion 设计用于处理 SQLAlchemy 和 peewee 模型。可集成其他数据存储。
示例代码:
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_potion import Api, ModelResource, fields
from flask_potion.routes import ItemRoute
app = Flask(__name__)
db = SQLAlchemy(app)
api = Api(app)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(), nullable=False)
db.create_all()
class UserResource(ModelResource):
class Meta:
model = User
@ItemRoute.GET
def greeting(self, user) -> fields.String():
return "Hello, {}!".format(user.name)
api.add_resource(UserResource)
if __name__ == '__main__':
app.run()
Programming Concurrency on the JVM
Venkat Subramaniam / The Pragmatic Bookshelf / 2011-6-1 / USD 35.00
Concurrency on the Java platform has evolved, from the synchronization model of JDK to software transactional memory (STM) and actor-based concurrency. This book is the first to show you all these con......一起来看看 《Programming Concurrency on the JVM》 这本书的介绍吧!
