1

Is it possible (how?) to build a select query programmatically in peewee? The point is to add .where() clauses as needed.

Nucular
  • 683
  • 1
  • 5
  • 19

1 Answers1

2
query = SomeThing.select()
if foo:
    query = query.where(SomeThing.value == 'foo')
else:
    query = query.where(...)
coleifer
  • 24,887
  • 6
  • 60
  • 75