4 ms·
Nice, a couple more recommendations: * Use update instead of get then save. It's shorter, faster, and safe from race conditions. * Use values{_list} instead
by coady 11y ago
Nice, a couple more recommendations:
* Use update instead of get then save. It's shorter, faster, and safe from race conditions.
* Use values{_list} instead of objects when only a few fields are required.
Those two anti-patterns are so prevalent I created a package dedicated to discouraging them: https://pypi.python.org/pypi/django-model-values https://pypi.python.org/pypi/django-model-values.