better use of sqlalchemy relationships