This is correct performance-wise (avoids the need for the database to build the entire result set before filtering; Django users reported a speed-up of factor 5‥2000 over naïve solutions) and (accepted by Nik) even more legible.
This is correct performance-wise (avoids the need for the database to build the entire result set before filtering; Django users reported a speed-up of factor 5‥2000 over naïve solutions) and (accepted by Nik) even more legible.