def METHOD_NAME(self):
    return (
        self._request.dbsession.query(User)
        .distinct()
        .outerjoin(settings_role, settings_role.id == User.settings_role_id)
        .outerjoin("roles")
        .options(subqueryload("settings_role"))
        .options(subqueryload("roles"))
    )