code from the ORM (Object Relational Management) tutorial from SQLAlchemy documentation for 0.9