Flask-RESTy 0.2.1
pip install Flask-RESTy==0.2.1
Newer version available (5.0.0)
Released:
Building blocks for REST APIs for Flask
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT
- Author: Jimmy Jia
- Tags rest , flask
Project description
Building blocks for REST APIs for Flask.
Usage
Create a SQLAlchemy model and a marshmallow schema, then:
from flask.ext.resty import Api, GenericModelView
from .models import Widget
from .schemas import WidgetSchema
class WidgetViewBase(GenericModelView):
model = Widget
schema = WidgetSchema()
class WidgetListView(WidgetViewBase):
def get(self):
return self.list()
def post(self):
return self.create()
class WidgetView(WidgetViewBase):
def get(self, id):
return self.retrieve(id)
def patch(self, id):
return self.update(id, partial=True)
def delete(self, id):
return self.destroy(id)
api = Api(app, '/api')
api.add_resource('/widgets', WidgetListView, WidgetView)
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT
- Author: Jimmy Jia
- Tags rest , flask
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Flask-RESTy-0.2.1.tar.gz
.
File metadata
- Download URL: Flask-RESTy-0.2.1.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
97ac16f96ac4948f7ab60238e4391740fbf86146e39495419c9ca34ec48f6c60
|
|
MD5 |
b751bf5c7660fbb37d3a4830a7dac5c2
|
|
BLAKE2b-256 |
8ed8125eaf0e550e6797bd6de964b980e8402d57740648073025d29ebe520997
|