mirror of https://github.com/django/django.git
Fixed #14867 -- Corrected references to baking in the new TemplateResponse docs. Thanks to marcusf for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14863 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c58d25cf8d
commit
b37d867929
|
@ -189,13 +189,13 @@ change is always applied. If you want to force the content to be
|
||||||
re-rendered, you can re-evaluate the rendered content, and assign
|
re-rendered, you can re-evaluate the rendered content, and assign
|
||||||
the content of the response manually::
|
the content of the response manually::
|
||||||
|
|
||||||
# Set up a baked TemplateResponse
|
# Set up a rendered TemplateResponse
|
||||||
>>> t = TemplateResponse(request, 'original.html', {})
|
>>> t = TemplateResponse(request, 'original.html', {})
|
||||||
>>> t.render()
|
>>> t.render()
|
||||||
>>> print t.content
|
>>> print t.content
|
||||||
Original content
|
Original content
|
||||||
|
|
||||||
# Rebaking doesn't change content
|
# Re-rendering doesn't change content
|
||||||
>>> t.template_name = 'new.html'
|
>>> t.template_name = 'new.html'
|
||||||
>>> t.render()
|
>>> t.render()
|
||||||
>>> print t.content
|
>>> print t.content
|
||||||
|
|
Loading…
Reference in New Issue