|
|
|
|
|
by Waterluvian
1179 days ago
|
|
On the topic of accidentally doing lots of extra queries, I love using Model.objects.raw to control exactly how it’s retrieving model data. I love how it keeps the results inside the Model realm but gives you careful control. I also like that if you access fields you didn’t ask for, it’ll go get them. But I wish it screamed louder when this happened. “Your logic works but we had to do extra queries. This might be an error!” So the featured article is incredibly valuable. This ought to be built-in. Django Silk has been critical for discovering these cases. They’re too easy to do. I love the middle ground of “ORM but you write the SQL.” |
|