Changes between Version 4 and Version 5 of ShortcutSyntaxIdeas


Ignore:
Timestamp:
Sep 21, 2005, 12:03:58 PM (19 years ago)
Author:
brantley (deadwisdom@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ShortcutSyntaxIdeas

    v4 v5  
    5555{{{
    5656#!python
    57 from django.utils import render
     57from django.core.template_loader import load_and_render
    5858
    5959def index(self, request):
    60      return render('index', 'title': 'Page Title', 'primes': [2, 3, 5, 7], 'header': 'The first 4 primes:')
     60     return load_and_render('index', 'title': 'Page Title', 'primes': [2, 3, 5, 7], 'header': 'The first 4 primes:')
    6161}}}
    6262
     
    121121=== Implementation ===
    122122
    123 This goes in django.utils:
     123This goes in django.core.template_loader:
    124124{{{
    125125#!python
    126 def render(template, dictionary):
     126def load_and_render(template, dictionary):
    127127    t = template_loader.get_template(template)
    128128    c = Context(dictionary)
Back to Top