def _simple_statement(self, context):
    if (not context.order_by):
        context.order_by = None
    if (self._distinct and context.order_by):
        order_by_col_expr = list(chain(*[sql_util.unwrap_order_by(o) for o in context.order_by]))
        context.primary_columns += order_by_col_expr
    context.froms += tuple(context.eager_joins.values())
    statement = sql.select((context.primary_columns + context.secondary_columns), context.whereclause, from_obj=context.froms, use_labels=context.labels, order_by=context.order_by, **self._select_args)
    statement._for_update_arg = context._for_update_arg
    for hint in self._with_hints:
        statement = statement.with_hint(*hint)
    if self._correlate:
        statement = statement.correlate(*self._correlate)
    if context.eager_order_by:
        statement.append_order_by(*context.eager_order_by)
    return statement
def _simple_statement(self, context):
    if (not context.order_by):
        context.order_by = None
    if (self._distinct and context.order_by):
        order_by_col_expr = list(chain(*[sql_util.unwrap_order_by(o) for o in context.order_by]))
        context.primary_columns += order_by_col_expr
    context.froms += tuple(context.eager_joins.values())
    statement = sql.select((context.primary_columns + context.secondary_columns), context.whereclause, from_obj=context.froms, use_labels=context.labels, order_by=context.order_by, **self._select_args)
    statement._for_update_arg = context._for_update_arg
    for hint in self._with_hints:
        statement = statement.with_hint(*hint)
    if self._correlate:
        statement = statement.correlate(*self._correlate)
    if context.eager_order_by:
        statement.append_order_by(*context.eager_order_by)
    return statement