In the `SingleObjectMixin` generic view mixin, the `get_context_data` method checks if the object is set by using: `if self.object`
I often include this mixin just for the `get_object` functionality and error handing it brings. I end up having to set `object = foo` or `object = None` to suppress the AttributeError
It seems like the class should initialize `self.object = None` instead of relying on a derived class setting it, especially because it doesn't guarantee that it will be added to the context - it only adds 'object' (and whatever the `context_object_name` param is) to the context if there's an object to add.
I'm sure there has been discussion on this before, but I was unable to find it here/trac.