Follow up to my own message. I found a way of testing this that I think
everyone should look at:
$ ./manage.py shell
Python 3.8.5 (default, Jul 21 2020, 10:48:26)
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveCons
bool(qs) is recommended when the queryset has already been run. If you do
something like
val = qs.earliest(some_property) if bool(qs) else None
then there isn’t a performance gain because it still has to run qs.exists() to
even see if there is a value. Later things like that will be cach
2 matches
Mail list logo