This is the boilerplate we use for SQLAlchemy. It seems a bit much for such a small app, but as it grows this can save us a huge number of lines of code.