Changes between Version 4 and Version 5 of ShortcutSyntaxIdeas
- Timestamp:
- Sep 21, 2005, 12:03:58 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ShortcutSyntaxIdeas
v4 v5 55 55 {{{ 56 56 #!python 57 from django. utils importrender57 from django.core.template_loader import load_and_render 58 58 59 59 def 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:') 61 61 }}} 62 62 … … 121 121 === Implementation === 122 122 123 This goes in django. utils:123 This goes in django.core.template_loader: 124 124 {{{ 125 125 #!python 126 def render(template, dictionary):126 def load_and_render(template, dictionary): 127 127 t = template_loader.get_template(template) 128 128 c = Context(dictionary)