Running Standalone SQLAlchemy Scripts in Pyramid

From time to time there comes the need to run automated scripts managed by either Python or Cron. In a recent project I had to run a standalone script that checks records on a database at certain hours. So here’s what I came up with. Most of the script is based on this post by [...]

Simpleform Localization in Pyramid

In a recent project I had to localize the errors thrown by the pyramid_simpleform package. Googling for information I couldn’t find how to do it, so here’s what worked for me at the end. from pyramid.i18n import get_locale_name from pyramid_simpleform import Form,State   from formencode import api as formencode_api   def includeme(config): config.scan(__name__) config.add_route(’login’, ‘/login’) [...]