#27101: args and kwargs not passed in BaseDetailView
-------------------------------+-----------------------------------
Reporter: Autographic | Owner: nobody
Type: Bug | Status: new
Component: Generic views | Version: 1.10
Severity: Normal | Keywords: BaseDetailView kwargs
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+-----------------------------------
In django.views.generic.detail.BaseDetailView's get() method, the
arguments and keyword arguments are not passed through for
SingleObjectMixin to locate the object. This snippet, from line 110 on,
repairs the issue:
{{{
class BaseDetailView(SingleObjectMixin, View):
"""
A base view for displaying a single object
"""
def get(self, request, *args, **kwargs):
### BUG: args and kwargs are not being stored!
self.args = args # Added 8/21/2016 by MJP
self.kwargs = kwargs # Added 8/21/2016 by MJP
self.object = self.get_object()
context = self.get_context_data(object=self.object)
return self.render_to_response(context)
}}}
The self.args line is probably redundant; I leave it to the developers'
judgement whether to include that or not.
--
Ticket URL: <https://code.djangoproject.com/ticket/27101>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" 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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/054.9d127480af9ddf353fdae9e478a41df3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.