select_stmt = select_stmt.where(table.c.project_id == project_id)
if b:
select_stmt = select_stmt.order_by((table.c.project_id, table.c.id))
Или так:
select_stmt = select([table])
if a:
select_stmt.where(table.c.project_id == project_id)
if b:
select_stmt.order_by((table.c.project_id, table.c.id))
Первое
Обсуждают сегодня