Code

Changes between Version 9 and Version 10 of ShortcutSyntaxIdeas


Ignore:
Timestamp:
09/21/05 11:48:15 (9 years ago)
Author:
Simon Willison
Comment:

Added "Idea 4: Simplified decorator"

Legend:

Unmodified
Added
Removed
Modified
  • ShortcutSyntaxIdeas

    v9 v10  
    7777}}} 
    7878 
     79== Idea 4: Simplified decorator == 
     80 
     81{{{ 
     82#!python 
     83from django.views.decorators.shortcuts import use_template 
     84 
     85@use_template('primes/index') 
     86def prime_index(request): 
     87    return { 
     88        'title': 'Page Title', 
     89        'primes': [2, 3, 5, 7], 
     90        'header': 'The first 4 primes' 
     91    } 
     92}}} 
    7993 
    8094== Implementations ==