Adds SQLAlchemy support to your Flask application.
Project description
SQLAlchemy-Handler is an extension that still like Flask-SQLAlchemy adds more support for SQLAlchemy to your application. It helps to handle models with humanized ids once it is jsonified, throws api errors for some casting of value during the save time.
[![CircleCI](https://circleci.com/gh/betagouv/sqlalchemy-handler/tree/master.svg?style=svg)](https://circleci.com/gh/betagouv/sqlalchemy-handler/tree/master) [![Coverage Status](https://coveralls.io/repos/github/betagouv/sqlalchemy-handler/badge.svg)](https://coveralls.io/github/betagouv/sqlalchemy-handler)
Installing
Install and update using pip:
$ pip install -U SQLAlchemy-Handler
A Simple Example
from flask import Flask
from sqlalchemy_handler import Handler
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///example.sqlite"
db = SQLAlchemy(app)
class User(Handler, db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String, unique=True, nullable=False)
email = db.Column(db.String, unique=True, nullable=False)
user = User(username="Flask", email="example@example.com")
Handler.save(user)
Links
Documentation: https://sqlalchemy-handler.betagouv.fr/
Issue tracker: https://github.com/betagouv/sqlalchemy-handler/issues
Test status: https://travis-ci.org/betagouv/sqlalchemy-handler
Test coverage: https://codecov.io/gh/betagouv/sqlalchemy-handler
Project details
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 Distributions
Built Distribution
Hashes for SQLAlchemy_Handler-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1864d224a25bb1edcdead38874e69476a1ee6bcd3eb72437e73d6eac6453ac20 |
|
MD5 | a991ccf4fe064ff5170b09c42fa1caee |
|
BLAKE2b-256 | 7b87b88a96fbbfafb0d694070b731962aeac406531cc325d782ea1a98970acc6 |