Add caching to SingleObjectMixin.get_object()
|Reported by:||anonymous||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||no|
Repeated calls to get_object() fetch the same object from the database. The object should only be fetched once and cached for subsequent calls.
Currently you have to pass the object around to various methods within your view (for example if you are using an attribute in get_success_url) to avoid calling get_object() multiple times if you are not using it in a view that sets self.object.