Opened 17 years ago

Closed 17 years ago

#6426 closed (fixed)

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

Reported by: panni@… Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords: #writing-custom-template-tags, custom template tags, load_template
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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().

Change History (2)

comment:1 by Chris Beaven, 17 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

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

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

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