Django

Code

Changeset 5578

Show
Ignore:
Timestamp:
06/30/07 23:44:39 (1 year ago)
Author:
adrian
Message:

newforms-admin: Changed _get_add_forms() and _get_change_forms() so they don't redefine the global Form object

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/newforms-admin/django/newforms/formsets.py

    r5577 r5578  
    5050    def _get_add_forms(self): 
    5151        """Return a list of all the add forms in this ``FormSet``.""" 
    52         Form = self.form_class 
     52        FormClass = self.form_class 
    5353        if not hasattr(self, '_add_forms'): 
    5454            add_forms = [] 
     
    5757                if self.data: 
    5858                    kwargs['data'] = self.data 
    59                 add_form = Form(**kwargs) 
     59                add_form = FormClass(**kwargs) 
    6060                self.add_fields(add_form, i) 
    6161                add_forms.append(add_form) 
     
    6666    def _get_change_forms(self): 
    6767        """Return a list of all the change forms in this ``FormSet``.""" 
    68         Form = self.form_class 
     68        FormClass = self.form_class 
    6969        if not hasattr(self, '_add_forms'): 
    7070            change_forms = [] 
     
    7575                if self.initial: 
    7676                    kwargs['initial'] = self.initial[i] 
    77                 change_form = Form(**kwargs) 
     77                change_form = FormClass(**kwargs) 
    7878                self.add_fields(change_form, i) 
    7979                change_forms.append(change_form)