Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#25963 closed Bug (fixed)

Clarify docs for render_to_response and context_instance deprecation

Reported by: Mark Tranchant Owned by: Tim Graham
Component: Documentation Version: 1.9
Severity: Normal Keywords: render, render_to_response, context_instance, RequestContext
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Mark Tranchant)

The render_to_response() documentation notes the deprecation of the context_instance argument:

"Deprecated since version 1.8: The context_instance argument is deprecated. Simply use context."

This advice is singularly unhelpful — it took me a fair amount of StackOverflow searching to work out what to do. I use the RequestContext to handle user messages and authorization, so it's essential for my project.

I'd suggest the note should read:

"Deprecated since version 1.8: The context_instance argument is deprecated. Simply use render() with the request as the first argument."

I don't know if that covers all use cases for the deprecation notice: if not, the original should be expanded to provide a better explanation. I've dragged my project along since 0.96 so am a fairly old hand yet it didn't make sense to me.

Change History (9)

comment:1 by Mark Tranchant, 8 years ago

Description: modified (diff)

comment:2 by Aymeric Augustin, 8 years ago

Triage Stage: UnreviewedAccepted

Indeed, this seems to trip up people regularly.

I mistakenly assumed that in 2015 everyone would be lazy enough to use render()

comment:3 by Tim Graham, 8 years ago

Owner: changed from nobody to Tim Graham
Status: newassigned
Summary: Docs for render_to_response and context_instance deprecationClarify docs for render_to_response and context_instance deprecation

comment:4 by Tim Graham, 8 years ago

Has patch: set

comment:5 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 36d0aa43:

[1.9.x] Fixed #25963 -- Clarified render_to_response() context_instance deprecation.

comment:6 by Tim Graham <timograham@…>, 8 years ago

In d156ae06:

[1.8.x] Fixed #25963 -- Clarified render_to_response() context_instance deprecation.

Backport of 36d0aa43036090685cebe6c9f757631cdadb1400 from stable/1.9.x

comment:7 by Mark Tranchant, 8 years ago

Thanks, that's much clearer now. Should help other people in my position with older code being forced to update by the deprecation timeline.

comment:8 by Tim Graham <timograham@…>, 8 years ago

In 28d05a4c:

Refs #25963 -- Fixed typo in docs/topics/http/shortcuts.txt

comment:9 by Tim Graham <timograham@…>, 8 years ago

In 326efed:

[1.9.x] Refs #25963 -- Fixed typo in docs/topics/http/shortcuts.txt

Backport of 28d05a4c195e2e01cdbc1435d58b44ece5ccc170 from master

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