Skip to main content

Storm integration for Flask.

Project description

Flask-Storm

Test status Documentation status PyPI version status

I only recommend using this package if your project is already heavily invested in Storm. Instead use SQLAlchemy and Flask-SQLAlchemy. It’s uncertain if Storm will ever receive another update

Flask-Storm is an extension for Flask that adds support for Canonical’s ORM Storm to your application. Flask-Storm automatically opens and closes database connections on demand when requests need them.

Example

Access to the database is done using the store application context local. Within an application context this variable holds a reference to a Storm Store instance. If no connection is opened it will automatically open one. When the application context is torn down, normally after the request has returned, the store is closed.

from flask_storm import store
from storm.locals import Int, Unicode

class User(object):
    __storm_table__ = "users"

    id = Int(primary=True)
    name = Unicode()


@app.route("/")
def index():
    # Get name of user with ID 1
    return store.get(User, 1).name

Installation

$ pip install flask_storm[fancy]

This installs Flask-Storm with SQL highlighting and reformatting support. If you do not want this drop the fancy.

$ pip install flask_storm

Documentation

Documentation is available on http://flask-storm.readthedocs.io/

Why not Python 3

Sadly Storm is not Python 3 compatible, which is why it doesn’t make sense to make Flask-Storm compatible yet.

Changelog

Version are structured like the following: <major>.<minor>.<bugfix>. Unless explicitly stated, changes are made by Andreas Runfalk.

Version 0.2.0

Released on 8th October 2018

  • Added Python 3 support
  • Removed storm as a dependency since storm-legacy can be used as well

Version 0.1.2

Released on 14th June 2017

  • Fixed an issue with query logging in flask shell and PostgreSQL

Version 0.1.1

Released on 9th June 2017

  • Fixed issue with new versions of sqlparse by bumping its version requirement

Version 0.1.0

Released on 19 July 2016

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
Flask_Storm-0.2.0-py2.py3-none-any.whl (11.5 kB) Copy SHA256 hash SHA256 Wheel py2.py3
Flask-Storm-0.2.0.tar.gz (24.4 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page