Yes, the proposal isn't new. Here is some related discussion: * https://code.djangoproject.com/ticket/21801 * https://github.com/django/django/pull/2260 * https://github.com/django/django/pull/4595 * https://github.com/django/django/pull/4526
On Friday, August 14, 2015 at 3:38:58 PM UTC-4, steve byerly wrote: > > 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. > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/9e93f58d-db87-4fb7-8177-f21334c6a839%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
