Opened 8 years ago

Closed 8 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 by Aleksandr Sobolev, 8 years ago

Owner: changed from nobody to Aleksandr Sobolev
Status: newassigned

comment:2 by Simon Charette, 8 years ago

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.

in reply to:  2 comment:3 by Dorian Amouroux, 8 years ago

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 by Aleksandr Sobolev, 8 years ago

Owner: Aleksandr Sobolev removed
Status: assignednew

comment:5 by Tim Graham, 8 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #21964 (closed as wontfix).

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