Kawsar Ahmed
Kawsar Ahmed

Reputation: 453

Is it possible to reset group_by items of a sqlalchemy query object in python?

I have a sqlalchemy query object which contains some group_by items added earlier using the query.group_by() method. I want to reset those items and add new group_by items. Is it possible? If so then please find me the way.

Upvotes: 2

Views: 129

Answers (1)

r-m-n
r-m-n

Reputation: 15120

The group_by columns are stored in _group_by property of the query object. You can set it to False or empty list []:

query._group_by = False

or

query._group_by = []

Upvotes: 1

Related Questions