Thanks for the suggestion. I agree that that's a useful pattern and one
I frequently use myself. The problem is that the model instance
namespace is a precious resource, and using up any more of it than we
already do can easily lead to backwards-compatibility problems. In this
case, I don't think turning a one-liner into a shorter one-liner
justifies using up more of that namespace.
Carl
Thanks for the suggestion. I agree that that's a useful pattern and one
I frequently use myself. The problem is that the model instance
namespace is a precious resource, and using up any more of it than we
already do can easily lead to backwards-compatibility problems. In this
case, I don't think turning a one-liner into a shorter one-liner
justifies using up more of that namespace.Carl
The "only_fields" kwarg suggestion comes from ticket 4102, and it is
primarily intended as a performance optimization for large models by
only sending the values of certain fields to the database at all,
something that your proposed code does not do.
Carl
It is also useful in the case where you have fields on the model which
have authoritatively changed, but have other local values which might
be stale.