teracyhq-incubator / flask-boilerplate Goto Github PK
View Code? Open in Web Editor NEWBoilerplate to speed up Flask development with best practices.
License: BSD 3-Clause "New" or "Revised" License
Boilerplate to speed up Flask development with best practices.
License: BSD 3-Clause "New" or "Revised" License
from:
@route('', methods=['GET'])
@token_auth_required()
@permissions_required(admin_role_permission)
@marshal_with(_user_list_schema)
@paginated
@use_args(search_args) # TODO(hoate): add support for @extract_args to avoid boilerplate
def index(self, args):
filters, args = extract_filters(args)
args['filters'] = filters
return auth_datastore.find_users(**args), args
to:
@route('', methods=['GET'])
@token_auth_required()
@permissions_required(admin_role_permission)
@marshal_with(_user_list_schema)
@paginated
@extract_args(search_args)
def index(self, args):
return auth_datastore.find_users(**args), args
and the messages should be clear.
CRUD and list => CRUDL
create -> POST
read -> GET
update -> PUT
delete -> DELETE
list -> GET
update this on https://github.com/teracyhq/flask-boilerplate/blob/develop/app/api/base.py#L166-L177
to:
special_methods = {
'get': ['GET'],
'put': ['PUT'],
'patch': ['PATCH'],
'post': ['POST'],
'delete': ['DELETE'],
'index': ['GET'],
'create': ['POST'],
'read': ['GET'],
'update': ['PUT'],
'list': ['GET']
}
note: remember to update existing resources (UserResource, RoleResource)
need to run full tests instead of just current unit tests
many places are broken due to latest incompatible changes from pip packages
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.