Commit Graph

15 Commits

Author SHA1 Message Date
Loic Bistuer 00a889167f Fixed #24295 -- Allowed ModelForm meta to specify form field classes.
Thanks Carl Meyer and Markus Holtermann for the reviews.
2015-02-13 19:13:05 +07:00
Duane Hilton 054bdfeff1 Fixed #17638 -- Added crosslinks between topic and reference guides.
Thanks oinopion for the suggestion and jarus for the initial patch.
2014-09-29 18:06:31 -04:00
Anders Steinlein 4ef10f245a Fixed #17642 -- Added min_num support to modelformsets, inlines, and the admin.
Thanks Stephen Burrows for work on the patch as well.

Forwardport of 2914f66983 from stable/1.7.x
2014-05-15 07:25:35 -04:00
Tim Graham 51c8045145 Removed versionadded/changed annotations for 1.6. 2014-03-24 11:42:56 -04:00
Tim Graham ee4edb1eda Made ModelForms raise ImproperlyConfigured if the list of fields is not specified.
Also applies to modelform(set)_factory and generic model views.

refs #19733.
2014-03-22 07:56:48 -04:00
Tim Graham 181f63c22d Fixed #12346 -- Added a note on how to validate InlineFormSets.
Thanks johnsmith for the suggestion.
2013-07-08 08:29:28 -04:00
Loic Bistuer 9e50833e22 Fixed #20000 -- Allowed ModelForm meta overrides for label, help_text and error_messages 2013-06-13 15:06:25 -04:00
Tim Graham bb863faecd Proofed the 1.6 release notes 2013-06-05 12:55:58 -04:00
Erik Romijn 756b81dbd1 Fixed #13546 -- Easier handling of localize field options in ModelForm 2013-05-18 14:13:00 +02:00
Luke Plant f026a519ae Fixed #19733 - deprecated ModelForms without 'fields' or 'exclude', and added '__all__' shortcut
This also updates all dependent functionality, including modelform_factory
 and modelformset_factory, and the generic views `ModelFormMixin`,
 `CreateView` and `UpdateView` which gain a new `fields` attribute.
2013-05-09 16:44:36 +01:00
Juan Catalano 78c842a323 Adapted uses of versionchanged/versionadded to the new form.
Refs #20104.
2013-04-20 17:18:35 +02:00
Andrew Gorcester f9ab543720 Fixed #20084 -- Provided option to validate formset max_num on server.
This is provided as a new "validate_max" formset_factory option defaulting to
False, since the non-validating behavior of max_num is longstanding, and there
is certainly code relying on it. (In fact, even the Django admin relies on it
for the case where there are more existing inlines than the given max_num). It
may be that at some point we want to deprecate validate_max=False and
eventually remove the option, but this commit takes no steps in that direction.

This also fixes the DoS-prevention absolute_max enforcement so that it causes a
form validation error rather than an IndexError, and ensures that absolute_max
is always 1000 more than max_num, to prevent surprising changes in behavior
with max_num close to absolute_max.

Lastly, this commit fixes the previous inconsistency between a regular formset
and a model formset in the precedence of max_num and initial data. Previously
in a regular formset, if the provided initial data was longer than max_num, it
was truncated; in a model formset, all initial forms would be displayed
regardless of max_num. Now regular formsets are the same as model formsets; all
initial forms are displayed, even if more than max_num. (But if validate_max is
True, submitting these forms will result in a "too many forms" validation
error!) This combination of behaviors was chosen to keep the max_num validation
simple and consistent, and avoid silent data loss due to truncation of initial
data.

Thanks to Preston for discussion of the design choices.
2013-03-21 01:27:24 -07:00
Nick Sandford 93e79b45bc Fixed #17416 -- Added widgets argument to inlineformset_factory and modelformset_factory 2013-01-24 08:58:17 +01:00
Tim Graham 5b2d9bacd2 Fixed #19640 - Added inlineformset_factory to reference docs.
Thanks wim@ for the suggestion.
2013-01-22 07:55:34 -05:00
Tim Graham 71d76ec011 Fixed #10239 - Added docs for modelform_factory
Thanks ingenieroariel for the suggestion and slurms for the review.
2013-01-11 06:00:19 -05:00