Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#26410 closed Cleanup/optimization (fixed)

Add a docs example for loader.render_to_string()

Reported by: Zach Borboa Owned by: Alberto Julio Leal Rivera
Component: Documentation Version: 1.9
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Hi. It appears the render_to_string shortcut example was removed. Can this example be added back to the docs? Thanks

Last seen in 1.7 docs
https://docs.djangoproject.com/en/1.7/ref/templates/api/#the-render-to-string-shortcut

Removed here
https://github.com/django/django/commit/ee8d5b91e94f6920f846512c978b703f62545ca8#diff-05455ade27e6c1bdf5c9a5140e5bcf96L930

Attachments (1)

26410.diff (2.1 KB ) - added by Alberto Julio Leal Rivera 9 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by Tim Graham, 9 years ago

Resolution: invalid
Status: newclosed

comment:2 by Zach Borboa, 9 years ago

Hi Tim, I don't see the render_to_string example on that page. Can this example be added back to the docs? Here's what was removed:

from django.template.loader import render_to_string
rendered = render_to_string('my_template.html', {'foo': 'bar'})

comment:3 by Tim Graham, 9 years ago

Component: UncategorizedDocumentation
Easy pickings: set
Summary: Documentation for render_to_string removedAdd a docs example for loader.render_to_string()
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

Oh, I guess I don't see a good reason why it was removed other than it's a bit simple.

comment:4 by Zach Borboa, 9 years ago

Resolution: invalid
Status: closednew

comment:5 by Alberto Julio Leal Rivera, 9 years ago

Owner: changed from nobody to Alberto Julio Leal Rivera
Status: newassigned

by Alberto Julio Leal Rivera, 9 years ago

Attachment: 26410.diff added

comment:6 by Alberto Julio Leal Rivera, 9 years ago

HI.
I compared the file version at https://github.com/django/django/commit/ee8d5b91e94f6920f846512c978b703f62545ca8#diff-05455ade27e6c1bdf5c9a5140e5bcf96L930 with the current version and because the file have changed alot since the last time render_to_string was on the docs , I decided to put the same information that was removed at the end of the document.

Do you consider that the information should by updated or moved to another place inside api.txt?

Thanks.

comment:7 by Tim Graham, 9 years ago

That information is already present in doc in a slightly rephrased form. I'll make the fix since it's trivial.

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

Resolution: fixed
Status: assignedclosed

In a65fc6df:

Fixed #26410 -- Added a docs example for loader.render_to_string().

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

In d58a324b:

[1.9.x] Fixed #26410 -- Added a docs example for loader.render_to_string().

Backport of a65fc6df891ab449e9c24160f6f6a1d6d2ccb282 from master

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