In Django, given that I have a QuerySet
that I am going to iterate over and print the results of, what is the best option for counting the objects? len(qs)
or qs.count()
?
(Also given that counting the objects in the same iteration is not an option.)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…