Opened 5 years ago

Closed 5 years ago

#27330 closed Bug (duplicate)

Generic CreateView/UpdateView doesn't send the kwargs to get_context_data

Reported by: Dorian Amouroux Owned by:
Component: Generic views Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

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.

Change History (5)

comment:1 Changed 5 years ago by Aleksandr Sobolev

Owner: changed from nobody to Aleksandr Sobolev
Status: newassigned

comment:2 Changed 5 years ago 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.

comment:3 in reply to:  2 Changed 5 years ago 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 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.

comment:4 Changed 5 years ago by Aleksandr Sobolev

Owner: Aleksandr Sobolev deleted
Status: assignednew

comment:5 Changed 5 years ago by Tim Graham

Resolution: duplicate
Status: newclosed

Duplicate of #21964 (closed as wontfix).

Note: See TracTickets for help on using tickets.
Back to Top