You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the version.previous attribute is calling VersionObjectFetcher.previous
Which runs: self.previous_query(obj).first()
Because it is using .first() - a query is running every time.
It would be a nice developer experience to cache this so it does not call multiple queries.
Currently I need to do:
current = ...
previous = current.previous
And then pass it all around in my functions to avoid performance issues.
It would make my code a lot simpler if the previous property cached the value so I did not need to save it in my own separate variable
The text was updated successfully, but these errors were encountered:
Currently, the version.previous attribute is calling
VersionObjectFetcher.previous
Which runs:
self.previous_query(obj).first()
Because it is using
.first()
- a query is running every time.It would be a nice developer experience to cache this so it does not call multiple queries.
Currently I need to do:
And then pass it all around in my functions to avoid performance issues.
It would make my code a lot simpler if the
previous
property cached the value so I did not need to save it in my own separate variableThe text was updated successfully, but these errors were encountered: