Changes between Version 12 and Version 13 of NewAdminChanges


Ignore:
Timestamp:
10/18/2005 05:21:45 PM (10 years ago)
Author:
adrian
Comment:

Changed code examples to use python syntax highlighting.

Legend:

Unmodified
Added
Removed
Modified
  • NewAdminChanges

    v12 v13  
    1313From:
    1414{{{
     15#!python
    1516def style_edit(request, object_id):   
    1617    try:
     
    4344To:
    4445{{{
     46#!python
    4547def style_edit(request, object_id):   
    4648    try:
     
    9193Suppress the field 'name'.
    9294{{{
     95#!python
    9396follow = {
    9497  'name': False,
     
    98101Show the editable=False field 'job'
    99102{{{
    100  
    101 follow = { 'job' : True, }
    102 
    103 
     103#!python
     104 follow = { 'job' : True, }
    104105}}}
    105106
    106107Show the set of related objects in the module 'choices'
    107108{{{
     109#!python
    108110follow = {
    109111   'choices': True,
     
    114116Show the set of related objects in the module 'choices', but suppress the 'poll' field of each choice object:
    115117{{{
    116 
     118#!python
    117119  follow = {
    118120     'choices': {
     
    120122     }
    121123  }
    122 
    123124}}}
    124125
    125126Put it all together:
    126127{{{
     128#!python
    127129  follow = {
    128130    'name' : False,
     
    137139
    138140{{{
     141#!python
    139142def style_edit_inline(request, object_id):   
    140143    try:
     
    166169 
    167170    return render_to_response('style_edit_inline', { 'form': form })
    168 
    169171}}}
    170172
     
    183185
    184186 This does require knowing the contents of the context for that template which is undocumented. Also this will probably change to a class to allow more flexibility, eg processing for style/grouping logic etc.
    185  
    186 
Back to Top