Changes between Version 38 and Version 39 of NewformsAdminBranch
- Timestamp:
- Nov 11, 2007, 8:34:50 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
NewformsAdminBranch
v38 v39 204 204 You have to add this line before {{{r'^admin(.*)'}}} otherwise it won't work. 205 205 206 === Renamed 'fields' to 'fieldsets' ===206 === Renamed 'fields' to 'fieldsets', and changed type of 'classes' value === 207 207 208 208 'Fields' is used to order and group fields in the change form layout.[[BR]] 209 209 It 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. 210 In case one uses fieldsets to organize the fields, one needs to use 'fieldsets' instead. [[BR]] 211 Also, 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. 211 212 212 213 An example: … … 222 223 class Admin: 223 224 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'}), 226 227 ) 227 228 … … 232 233 class MyModelB_Options(admin.ModelAdmin): 233 234 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')}), 236 237 ) 237 238 }}}