Changes between Version 9 and Version 10 of ShortcutSyntaxIdeas


Ignore:
Timestamp:
Sep 21, 2005, 1:48:15 PM (19 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 ==
Back to Top