tool v0.5.0 documentation

Storm ORM

«  SQLObject ORM   ::   Contents   ::   Web Admin  »

Storm ORM

state:stable
dependencies:Storm
feature:orm

Support for Storm, an object-relational mapper (ORM) for Python developed at Canonical.

dependencies:storm

Configuration

Example configuration (YAML):

tool.ext.storm_orm.Storm:
    uri: "sqlite:"

Usage

Example usage:

from tool import app

joe = Person()
joe.name = 'Joe'

orm = app.get_feature('orm')

orm.db.add(joe)
orm.db.find(Person, Person.name=='Joe').one()

See the Storm tutorial for details. Just replace store with orm.db and here you are.

API reference

class tool.ext.storm_orm.Storm(app, conf)

Adds the ORM feature.

Required configuration options:

Parameter:uri – a string describing the connection, as follows: scheme://username:password@hostname:port/database_name (see creating database in tutorial).
db
The storm.locals.Store instance, as configured here by tool.application.Application.

«  SQLObject ORM   ::   Contents   ::   Web Admin  »