Code

Changes between Version 30 and Version 31 of NewformsHOWTO


Ignore:
Timestamp:
04/22/08 07:33:13 (6 years ago)
Author:
Lllama <f.ingram.lists@…>
Comment:

Update for change from fieldsets_change to get_fieldsets

Legend:

Unmodified
Added
Removed
Modified
  • NewformsHOWTO

    v30 v31  
    488488    hidden_fields = ("created", "updated") # Define which fields you'd like to be hidden here. 
    489489 
    490     def fieldsets_change(self, request, obj): 
     490    def get_fieldsets(self, request, obj=None): 
    491491        superclass = super(ArticleOptions, self) 
    492         fieldsets = superclass.fieldsets_change(request, obj) 
    493  
    494         # Here we cycle through the fieldsets and remove the created and updated 
    495         # fields by name. Factoring this out left as an exercise for the reader. 
    496         for fs in fieldsets: 
    497             fs[1]['fields'] = [f for f in fs[1]['fields'] 
    498                                  if f not in self.hidden_fields] 
    499         return fieldsets 
    500  
    501     def fieldsets_add(self, request): 
    502         superclass = super(ArticleOptions, self) 
    503         fieldsets = superclass.fieldsets_add(request) 
     492        fieldsets = superclass.get_fieldsets(request, obj) 
    504493 
    505494        # Here we cycle through the fieldsets and remove the created and updated