sqlalchemy filter by relationship count