The ``pyramid_sqla`` package version 0.1 has been released. It contains a library for SQLAlchemy access and an application template closer to Pylons 1 than those that come with Pyramid. This is an alpha release for community testing and feedback; the API is not guaranteed to be stable yet. My goal is a 1.0 release before Pyramid 1.0.
The ``pyramid_sqla`` package (installed in site-packages) replaces the 'meta.py' module in Pylons 1 applications, allowing 'models' to be a package without circular imports. A basic script to create tables is included. The application template serves static files from "/" like Pylons does, using special route options to make this an ordinary route without masking your dynamic URLs or traversal. This allows you to deal with /favicon.ico and /robots.txt the same way as your other static files. The application template also includes a helpers.py module tied to the ``h`` template variable, serves *.html templates via Mako (configurable), has a full logging configuration in development.ini including a logger for the application package, and listens on 127.0.0.1:5000 by default. It also includes a basic script to create database tables, akin to 'websetup.py' in Pylons 1 applications. My goal is a 1.0 release before Pyramid 1.0. Pyramid's application templates will be consolidated down to one without SQLAlchemy, and this will be the add-on template for SQLAlchemy/Pylons-like applications. I discussed with Ben how to migrate from Pylons 1's meta.py, and we came up with this approach of a library holding the scoped session, a collection of engines, and a declarative base, all accessed by accessor functions. This avoids circular dependencies in package-format models, and allows the maximum part of the model to be defined at model level (always importable) rather than in ``init_model()``. A few scenarios --namely reflection -- will still require ``init_model()``, unless you can guarantee that the library is initialized before the the model is imported -- but there's no way around that. In ordinary use that shouldn't matter because myapp/__init__.py configures the engines before the model is imported, but Nosetests imports modules willy-nilly looking for tests. I think this configuration is robust enough for Nosetests, but that needs more testing. So please send feedback. Version: 0.1, released 2011-01-12 Docs: https://bitbucket.org/sluggo/pyramid_sqla/wiki/html/index.html Download: http://pypi.python.org/packages/source/p/pyramid_sqla/pyramid_sqla-0.1.tar.gz PyPI: http://pypi.python.org/pypi/pyramid_sqla Source: http://bitbucket.org/sluggo/pyramid_sqla (Mercurial) -- Mike Orr <sluggos...@gmail.com> -- You received this message because you are subscribed to the Google Groups "pylons-devel" group. To post to this group, send email to pylons-de...@googlegroups.com. To unsubscribe from this group, send email to pylons-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/pylons-devel?hl=en.