Loading django/forms/formsets.py +3 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,9 @@ class BaseFormSet(object): def get_form_kwargs(self, index): """ Return additional keyword arguments for each individual formset form. index will be None if the form being constructed is a new empty form. """ return self.form_kwargs.copy() Loading docs/releases/1.9.txt +3 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,9 @@ Forms * A form prefix can be specified inside a form class, not only when instantiating a form. See :ref:`form-prefix` for details. * You can now :ref:`specify keyword arguments <custom-formset-form-kwargs>` that you want to pass to the constructor of forms in a formset. Generic Views ^^^^^^^^^^^^^ Loading docs/topics/forms/formsets.txt +2 −0 Original line number Diff line number Diff line Loading @@ -535,6 +535,8 @@ default fields/attributes of the order and deletion fields:: <tr><th><label for="id_form-0-pub_date">Pub date:</label></th><td><input type="text" name="form-0-pub_date" id="id_form-0-pub_date" /></td></tr> <tr><th><label for="id_form-0-my_field">My field:</label></th><td><input type="text" name="form-0-my_field" id="id_form-0-my_field" /></td></tr> .. _custom-formset-form-kwargs: Passing custom parameters to formset forms ------------------------------------------ Loading Loading
django/forms/formsets.py +3 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,9 @@ class BaseFormSet(object): def get_form_kwargs(self, index): """ Return additional keyword arguments for each individual formset form. index will be None if the form being constructed is a new empty form. """ return self.form_kwargs.copy() Loading
docs/releases/1.9.txt +3 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,9 @@ Forms * A form prefix can be specified inside a form class, not only when instantiating a form. See :ref:`form-prefix` for details. * You can now :ref:`specify keyword arguments <custom-formset-form-kwargs>` that you want to pass to the constructor of forms in a formset. Generic Views ^^^^^^^^^^^^^ Loading
docs/topics/forms/formsets.txt +2 −0 Original line number Diff line number Diff line Loading @@ -535,6 +535,8 @@ default fields/attributes of the order and deletion fields:: <tr><th><label for="id_form-0-pub_date">Pub date:</label></th><td><input type="text" name="form-0-pub_date" id="id_form-0-pub_date" /></td></tr> <tr><th><label for="id_form-0-my_field">My field:</label></th><td><input type="text" name="form-0-my_field" id="id_form-0-my_field" /></td></tr> .. _custom-formset-form-kwargs: Passing custom parameters to formset forms ------------------------------------------ Loading