Django

Code

Ticket #6426 (closed: fixed)

Opened 11 months ago

Last modified 10 months ago

Documentation fault at #writing-custom-template-tags, load_template

Reported by: panni@fragstore.net Assigned to: nobody
Milestone: Component: Documentation
Version: SVN Keywords: #writing-custom-template-tags, custom template tags, load_template
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Auto-escaping considerations >> New in Django development version states:

def render(self, context):
    t = template.load_template('small_fragment.html')
    return t.render(Context({'var': obj}, autoescape=context.autoescape))

This simply won't work because you're referring to django.template.load_template, which doesn't exist. You probably mean django.template.loader.get_template(), or render_to_string().

Attachments

Change History

01/20/08 18:28:54 changed by SmileyChris

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

02/18/08 17:43:12 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(In [7130]) Fixed a few errors in the documentation. Thanks, Matthew Flanagan, panni@fragstore.net and adamv.

Fixed #6411, #6426, #6524, #6555.


Add/Change #6426 (Documentation fault at #writing-custom-template-tags, load_template)




Change Properties
Action