[Django] #27330: Generic CreateView/UpdateView doesn't send the kwargs to get_context_data

26 views
Skip to first unread message

Django

unread,
Oct 9, 2016, 3:01:13 PM10/9/16
to django-...@googlegroups.com
#27330: Generic CreateView/UpdateView doesn't send the kwargs to get_context_data
---------------------------------+--------------------
Reporter: Dorian Amouroux | Owner: nobody
Type: Bug | Status: new
Component: Generic views | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 1 | UI/UX: 0
---------------------------------+--------------------
I noticed that the generic classes CreateView and UpdateView doesn't
inject the kwargs into the `get_context_data()` method.

We can see here
https://github.com/django/django/blob/stable/1.10.x/django/views/generic/edit.py#L174
that the methods `get` and `post` call `get_context_data` without
`**kwargs` in parameter.

I couldn't find a reason for that.

--
Ticket URL: <https://code.djangoproject.com/ticket/27330>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 9, 2016, 3:10:43 PM10/9/16
to django-...@googlegroups.com
#27330: Generic CreateView/UpdateView doesn't send the kwargs to get_context_data
-------------------------------------+-------------------------------------
Reporter: Dorian Amouroux | Owner: Aleksandr
| Sobolev
Type: Bug | Status: assigned

Component: Generic views | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Aleksandr Sobolev):

* status: new => assigned
* needs_better_patch: => 0
* owner: nobody => Aleksandr Sobolev
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/27330#comment:1>

Django

unread,
Oct 9, 2016, 3:17:54 PM10/9/16
to django-...@googlegroups.com
#27330: Generic CreateView/UpdateView doesn't send the kwargs to get_context_data
-------------------------------------+-------------------------------------
Reporter: Dorian Amouroux | Owner: Aleksandr
| Sobolev
Type: Bug | Status: assigned
Component: Generic views | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

Quoting Tim on #21964:

> pushing `kwargs` to the context has been called an anti-pattern in
#19878 and we're planning to deprecate that behavior in TemplateView.

--
Ticket URL: <https://code.djangoproject.com/ticket/27330#comment:2>

Django

unread,
Oct 9, 2016, 3:52:12 PM10/9/16
to django-...@googlegroups.com
#27330: Generic CreateView/UpdateView doesn't send the kwargs to get_context_data
-------------------------------------+-------------------------------------
Reporter: Dorian Amouroux | Owner: Aleksandr
| Sobolev
Type: Bug | Status: assigned
Component: Generic views | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Dorian Amouroux):

I have hard time to follow the decision around it. I can't find in the
documentation the new way to send additional information to generic view.
Replying to [comment:2 Simon Charette]:


> Quoting Tim on #21964:
>
> > pushing `kwargs` to the context has been called an anti-pattern in
#19878 and we're planning to deprecate that behavior in TemplateView.

--
Ticket URL: <https://code.djangoproject.com/ticket/27330#comment:3>

Django

unread,
Oct 10, 2016, 2:48:15 AM10/10/16
to django-...@googlegroups.com
#27330: Generic CreateView/UpdateView doesn't send the kwargs to get_context_data
---------------------------------+--------------------------------------
Reporter: Dorian Amouroux | Owner: (none)

Type: Bug | Status: new
Component: Generic views | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by Aleksandr Sobolev):

* status: assigned => new
* owner: Aleksandr Sobolev => (none)


--
Ticket URL: <https://code.djangoproject.com/ticket/27330#comment:4>

Django

unread,
Oct 10, 2016, 8:03:01 AM10/10/16
to django-...@googlegroups.com
#27330: Generic CreateView/UpdateView doesn't send the kwargs to get_context_data
---------------------------------+--------------------------------------
Reporter: Dorian Amouroux | Owner: (none)
Type: Bug | Status: closed

Component: Generic views | Version: 1.10
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => duplicate


Comment:

Duplicate of #21964 (closed as wontfix).

--
Ticket URL: <https://code.djangoproject.com/ticket/27330#comment:5>

Reply all
Reply to author
Forward
0 new messages