2 ms·
The second argument should also include correctness: if I increment two variables on that object (e.g. votes and last_vote_time) it needs to be a single atomic
by acdha 9y ago
The second argument should also include correctness: if I increment two variables on that object (e.g. votes and last_vote_time) it needs to be a single atomic operation to not create a hard to debug race condition.
It seems better to explicitly say when to save things rather than hope that every custom method does that and you have a method for every combination of updates.
The Django ORM also has another case to consider: bulk updates, where separating logic from serialization makes a huge performance win easy and safe.