Version:1.0rc1, released 2011-01-26
Source: (Mercurial)

pyramid_sqla is DEPRECATED. It has split into two distributions: Akhet (the application template) and SQLAHelper (the SQLAlchemy library). Please migrate any applications to Akhet by creating a new application and pasting your code into it. Akhet has detailed documentation which will help show what goes where.

pyramid_sqla is a library for Pyramid applications using SQLAlchemy, and an application template that brings some of Pylons 1’s features to Pyramid. The API is now stable; version 1.0rc1 is a release candidate for 1.0.

Important note for version 0.1 users

Pyramid 1.0a10 made an incompatible change for applications created with pyramid_sqla 0.1. To use these applications with Pyramid 1.0a10 or later, edit the applications’ and add ‘pyramid_handlers’ to the ‘requires’ list, and reinstall the applications.

Current features in the library

  • A SQLAlchemy scoped session, a place to register database engines, and a declarative base. These all replace the meta module in Pylons 1 applications, making it easier to structure module code freely without circular imports
  • Initialization requires just one line in per database, and no boilerplate code in model
  • Session management à la TurboGears. This commits all changes at the end of a request, or rolls them back if an exception has occurred. You can still commit and roll back on demand, and even prevent other parts of the application from committing during the request.

Current features in the application template

  • The model, application settings, middleware, and logging are preconfigured for a Pylons 1-like SQLAlchemy application
  • The static directory is served under “/” instead of “/static”, overlaying your dynamic URLs
  • Routing using URL dispatch and view handlers, similar to Routes and controllers in Pylons 1
  • Listen on localhost:5000 by default (localhost for security, 5000 per Pylons 1 precedent)
  • Templates ending in .html are passed to Mako (or to your desired templater)
  • A helpers module and the h template global. (You can change template globals in the subscribers module.)
  • A separate logger is configured for the application package, and is added to the handlers module
  • Configures logging in .ini and handlers
  • A script to initialize your database
  • A production.ini (new in 1.0rc1)

pyramid_sqla has five dependencies: Pyramid, SQLAlchemy, repoze.tm2, zope.sqlalchemy, and transaction. It’s tested on Python 2.6/Linux but should work on 2.5 and other platforms. A set of unit tests is included.

Indices and tables