Module: elixir

A declarative layer on top of SQLAlchemy, which is intended to replace the ActiveMapper SQLAlchemy extension, and the TurboEntity project. Elixir is a fairly thin wrapper around SQLAlchemy, which provides the ability to define model objects following the Active Record design pattern, and using a DSL syntax similar to that of the Ruby on Rails ActiveRecord system.

Elixir does not intend to replace SQLAlchemy's core features, but instead focuses on providing a simpler syntax for defining model objects when you do not need the full expressiveness of SQLAlchemy's manual mapper definitions.

For an example of how to use Elixir, please refer to the examples directory and the unit tests. The examples directory includes a TurboGears application with full identity support called 'videostore'.

Modules

entity

fields

This module contains DSL statements which allow you to declare which fields (columns) your Elixir entities have. There are currently two different statements that you can use to declare fields:

options

This module provides DSL statements for defining options on your Elixir entities. There are three different kinds of options that can be set up, and for this there are three different statements: using_options, using_table_options and using_mapper_options. Alternatively, options can be set on all Elixir entities by modifying the options_defaults dictionary before defining any entity.

relationships

This module provides support for defining relationships between your Elixir entities. Elixir supports the following types of relationships: belongs_to, has_one, has_many and has_and_belongs_to_many.

Functions

cleanup_all ()

Drop table and clear mapper for all entities, and clear all metadatas.

create_all ()

Create all necessary tables for all declared entities

drop_all ()

Drop all tables for all declared entities

setup_all ()

Setup the table and mapper for all entities which have been delayed.

This should be used in conjunction with setting delay_setup to True before defining your entities.

Attributes

delay_setup

Value of delay_setup

False

metadata

Value of metadata

MetaData()

objectstore

Value of objectstore

<elixir.Objectstore object at 0x14bc5d0>