Skip to main content

Storm integration for Flask.

Project description

Flask-Storm
===========
|test-status| |documentation-status| |pypi-version|

*I only recommend using this package if your project is already heavily invested in Storm. Instead use* `SQLAlchemy <https://github.com/zzzeek/sqlalchemy>`_ *and* `Flask-SQLAlchemy <https://github.com/mitsuhiko/flask-sqlalchemy>`_. *It's uncertain if Storm will ever receive another update*

Flask-Storm is an extension for `Flask <https://www.palletsprojects.com/p/flask/>`_ that adds support for Canonical's ORM `Storm <https://storm.canonical.com/>`_ 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 <http://flask.pocoo.org/docs/0.11/appcontext/>`_. 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.

.. code-block:: python

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
------------

.. code-block:: bash

$ pip install flask_storm[fancy]

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

.. code-block:: bash

$ 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.

.. |test-status| image:: https://travis-ci.org/runfalk/flask-storm.svg
:alt: Test status
:scale: 100%
:target: https://travis-ci.org/runfalk/Flask-Storm

.. |documentation-status| image:: https://readthedocs.org/projects/flask-storm/badge/
:alt: Documentation status
:scale: 100%
:target: http://flask-storm.readthedocs.io/

.. |pypi-version| image:: https://badge.fury.io/py/Flask-Storm.svg
:alt: PyPI version status
:scale: 100%
:target: https://pypi-hypernode.com/pypi/Flask-Storm/

.. Include changelog on PyPI

Changelog
=========
Version are structured like the following: ``<major>.<minor>.<bugfix>``. Unless
explicitly stated, changes are made by
`Andreas Runfalk <https://github.com/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.

Source Distribution

Flask-Storm-0.2.0.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

Flask_Storm-0.2.0-py2.py3-none-any.whl (11.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file Flask-Storm-0.2.0.tar.gz.

File metadata

  • Download URL: Flask-Storm-0.2.0.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for Flask-Storm-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2e8f77dd162411d8c58921c0614a72bd02ee94db4dcc495c31223be437744866
MD5 bcf0636f342c1b6d9a25b346f8d1831d
BLAKE2b-256 9e2e11524fa169d85e9943e0d7cd2313e7262c85b66a563377e8a0c6dd38194c

See more details on using hashes here.

File details

Details for the file Flask_Storm-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: Flask_Storm-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for Flask_Storm-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 58d3d26726005800d22245ad20b2cacc05f43c2342892f2e1517c0707f23d9b4
MD5 4b48e992101e06ff52548331d653e2aa
BLAKE2b-256 8fca3096225dbcb1db8f507787ba2944439ddc85e4ce62418f1e69c635760dc1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page