Closed fmazan closed 5 months ago
A change introduced in https://github.com/coleifer/peewee/commit/148f1b76684af750db239a5220769d43260c57a5 causes incompatibility in the case of bool function is called before any row is fetched after execution or the row_cache is filled.
count = MyModel.select().count() # 42 cursor = MyModel.select().for_update().execute() # Does not have to be for_update, it's just for demo # cursor.__bool__() == False
count = MyModel.select().count() # 42 cursor = MyModel.select().for_update().execute() list(cursor) # cursor.__bool__() == True
Expected behavior from my point of view is the bool evaluation be True if the query succeeded.
A change introduced in https://github.com/coleifer/peewee/commit/148f1b76684af750db239a5220769d43260c57a5 causes incompatibility in the case of bool function is called before any row is fetched after execution or the row_cache is filled.
Expected behavior from my point of view is the bool evaluation be True if the query succeeded.