Opened 9 years ago
Closed 9 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 , 9 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
follow-up: 3 comment:2 by , 9 years ago
comment:3 by , 9 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
kwargsto the context has been called an anti-pattern in #19878 and we're planning to deprecate that behavior in TemplateView.
comment:4 by , 9 years ago
| Owner: | removed |
|---|---|
| Status: | assigned → new |
comment:5 by , 9 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
Duplicate of #21964 (closed as wontfix).
Quoting Tim on #21964: