fix sqlalchemy issue with multiple fks on same model