Changes between Version 38 and Version 39 of NewformsAdminBranch


Ignore:
Timestamp:
Nov 11, 2007, 8:34:50 AM (17 years ago)
Author:
Karen Tracey <kmtracey@…>
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NewformsAdminBranch

    v38 v39  
    204204You have to add this line before {{{r'^admin(.*)'}}} otherwise it won't work.
    205205
    206 === Renamed 'fields' to 'fieldsets' ===
     206=== Renamed 'fields' to 'fieldsets', and changed type of 'classes' value ===
    207207
    208208'Fields' is used to order and group fields in the change form layout.[[BR]]
    209209It is still available in the new admin, but it accepts only a list of fields. [[BR]]
    210 In case one uses fieldsets to organize the fields, one needs to use 'fieldsets' instead.
     210In case one uses fieldsets to organize the fields, one needs to use 'fieldsets' instead. [[BR]]
     211Also, if 'classes' is specified in a field specification, then the type of its value needs to be changed from a string to a tuple of strings when migrating to the new 'fieldsets' specification.
    211212
    212213An example:
     
    222223   class Admin:
    223224     fields = (
    224        ('group1', {'fields': ('field1','field2')}),
    225        ('group2', {'fields': ('field3','field4')}),
     225       ('group1', {'fields': ('field1','field2'), 'classes': 'collapse'}),
     226       ('group2', {'fields': ('field3','field4'), 'classes': 'collapse wide'}),
    226227       )
    227228
     
    232233class MyModelB_Options(admin.ModelAdmin):
    233234     fieldsets = (
    234        ('group1', {'fields': ('field1','field2')}),
    235        ('group2', {'fields': ('field3','field4')}),
     235       ('group1', {'fields': ('field1','field2'), 'classes': ('collapse',)}),
     236       ('group2', {'fields': ('field3','field4'), 'classes': ('collapse', 'wide')}),
    236237       )
    237238}}}
Back to Top