New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
model.COUNT() only firing once per action. (the same Column Statistic will only fire once per action?) #562
Comments
All model queries are cached for the duration of the request To force a reload, add reload=true to the model call, i.e. On 28 October 2015 at 16:16, kmd1970 notifications@github.com wrote:
|
Hi Andy, Thanks for the quick reply. The |
Reopening so we can document. |
Got this documented. Also replaced the "See docs for findall" references with the appropriate descriptions. |
Great, thanks Chris. |
Thanks. |
When I call this
test
action I expect to get0 1
as the output from each modelcount()
, however I always get0 0
.When I check my debug, only one SQL
count(*)
is executed and and then two SQLinserts
right after. Shouldn't all code be executed in the order written?I am expecting one SQL
count(*)
statement right before each SQLinsert
to return the number of similar items inserted. I've tried addingsave(transaction='commit')
and usingcreate()
, but the results are the same. Confused?This results in only one SQL count(*) being executed, because the WHERE clause is the same.
My Table
The text was updated successfully, but these errors were encountered: