diff options
| author | Brian Rosner <brosner@gmail.com> | 2008-06-10 03:54:05 +0000 |
|---|---|---|
| committer | Brian Rosner <brosner@gmail.com> | 2008-06-10 03:54:05 +0000 |
| commit | 3b92ced51856e740cd6fb3d3e5bb8ea932bd276e (patch) | |
| tree | 6eafa71c49c140116f616cf8b07e0c91bb7aaa67 /django/newforms/formsets.py | |
| parent | bb75091bf46d9921ecdd89155866e929cc70a38e (diff) | |
newforms-admin: Fixed #5520 -- Implemented save_as functionality. This also
properly makes inlines work as well.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7603 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/newforms/formsets.py')
| -rw-r--r-- | django/newforms/formsets.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/django/newforms/formsets.py b/django/newforms/formsets.py index b9e4a1fd02..8a76a54042 100644 --- a/django/newforms/formsets.py +++ b/django/newforms/formsets.py @@ -57,14 +57,18 @@ class BaseFormSet(StrAndUnicode): initial = {TOTAL_FORM_COUNT: self._total_form_count, INITIAL_FORM_COUNT: self._initial_form_count} self.management_form = ManagementForm(initial=initial, auto_id=self.auto_id, prefix=self.prefix) - # instantiate all the forms and put them in self.forms - self.forms = [] - for i in range(self._total_form_count): - self.forms.append(self._construct_form(i)) + # construct the forms in the formset + self._construct_forms() def __unicode__(self): return self.as_table() + def _construct_forms(self): + # instantiate all the forms and put them in self.forms + self.forms = [] + for i in xrange(self._total_form_count): + self.forms.append(self._construct_form(i)) + def _construct_form(self, i): """ Instantiates and returns the i-th form instance in a formset. |
