javascript style scoping for sqlalchemy ORM mapper