diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-07-01 04:44:39 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-07-01 04:44:39 +0000 |
| commit | 836d2e759102d9a8db389dc2a07a9223a69d377d (patch) | |
| tree | 2915b07ad965a1fba3228ce590eed1c0989720a8 | |
| parent | 3bdc14818f265ab0f26ddc93c1a3a9ce450e0c09 (diff) | |
newforms-admin: Changed _get_add_forms() and _get_change_forms() so they don't redefine the global Form object
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@5578 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/newforms/formsets.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/django/newforms/formsets.py b/django/newforms/formsets.py index f3477226ca..eb8eb309f3 100644 --- a/django/newforms/formsets.py +++ b/django/newforms/formsets.py @@ -49,14 +49,14 @@ class BaseFormSet(object): def _get_add_forms(self): """Return a list of all the add forms in this ``FormSet``.""" - Form = self.form_class + FormClass = self.form_class if not hasattr(self, '_add_forms'): add_forms = [] for i in range(self.change_form_count, self.total_forms): kwargs = {'auto_id': self.auto_id, 'prefix': self.add_prefix(i)} if self.data: kwargs['data'] = self.data - add_form = Form(**kwargs) + add_form = FormClass(**kwargs) self.add_fields(add_form, i) add_forms.append(add_form) self._add_forms = add_forms @@ -65,7 +65,7 @@ class BaseFormSet(object): def _get_change_forms(self): """Return a list of all the change forms in this ``FormSet``.""" - Form = self.form_class + FormClass = self.form_class if not hasattr(self, '_add_forms'): change_forms = [] for i in range(0, self.change_form_count): @@ -74,7 +74,7 @@ class BaseFormSet(object): kwargs['data'] = self.data if self.initial: kwargs['initial'] = self.initial[i] - change_form = Form(**kwargs) + change_form = FormClass(**kwargs) self.add_fields(change_form, i) change_forms.append(change_form) self._change_forms= change_forms |
