sqlalchemy relationship custom query