Changes between Version 17 and Version 18 of ShortcutSyntaxIdeas


Ignore:
Timestamp:
Sep 22, 2005, 5:05:14 AM (19 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ShortcutSyntaxIdeas

    v17 v18  
    9999from django.views.decorators.shortcuts import use_template
    100100
    101 class AClass(BaseClass):
     101class ViewClass(BaseClass):
    102102    #class level attributes here (e.g. for the menu generation - see below)
    103103
    104     @use_template('primes/index')
    105     def prime_index(request):
     104    @use_template('page_one')
     105    def page_one(request):
    106106        return {
    107107            'title': 'Page Title',
    108             'primes': [2, 3, 5, 7],
    109             'header': 'The first 4 primes'
     108            # other data
     109        }
     110
     111    @use_template('page_two')
     112    def page_two(request):
     113        return {
     114            'title': 'Page Title',
     115            # other data
    110116        }
    111117}}}
Back to Top