Commit Graph

49 Commits

Author SHA1 Message Date
Tim Graham 2fd61285d1 Fixed #20471 - Typos in topics/forms/formsets.txt 2013-05-20 13:56:19 -04:00
Ryan Kaskel 4280217f31 Fixed #20403 -- Ignore forms marked for deletion when validating max_num. 2013-05-20 12:13:21 -04:00
leandrafinger 08b501e7d3 add missing imports to the examples in the 'Forms' 2013-05-19 13:31:45 +02:00
Juan Catalano 78c842a323 Adapted uses of versionchanged/versionadded to the new form.
Refs #20104.
2013-04-20 17:18:35 +02:00
Simon Charette 1de63cccb1 Fixed #20263 -- Corrected wording in the formset documentation.
Thanks to feraudyh at yahoo.com for the report.
2013-04-15 12:19:17 -04:00
Tim Graham 4a1d425cfe Fixed #8649 - Documented a caveat about dynamically adjusting formsets. 2013-03-31 04:34:28 -04: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
Claude Paroz 7ec2a21be1 Fixed #19686 -- Added HTML5 number input type
Thanks Simon Charette for his help on the patch. Refs #16630.
2013-02-23 10:18:08 +01:00
Aymeric Augustin 35c991aa06 Added a default limit to the maximum number of forms in a formset.
This is a security fix. Disclosure and advisory coming shortly.
2013-02-19 11:23:30 -07:00
JonLoy 74003ca36b Fixed #19808 Capitalization error in example text 2013-02-12 09:14:19 -05:00
Tim Graham 9b5f64cc6e Fixed #19516 - Fixed remaining broken links.
Added -n to sphinx builds to catch issues going forward.
2013-01-02 18:32:57 -05:00
Aymeric Augustin 7ee7599ab3 Removed versionadded/changed annotations dating back to 1.4. 2012-12-29 21:59:08 +01:00
Tim Graham 067505ad19 Fixed broken links, round 4. refs #19516 2012-12-29 15:54:33 -05:00
Tim Graham 837425b425 Fixed #18934 - Removed versionadded/changed annotations for Django 1.3 2012-09-20 19:06:55 -04:00
Aymeric Augustin c28e700c7e Removed references to changes made in 1.2.
Thanks Florian Apolloner for the patch.
2012-06-07 15:02:35 +02:00
Claude Paroz 6219591f2e Fixed #18244 -- Documented that formset.has_changed is a 1.4 addition. 2012-05-22 13:56:03 +02:00
Claude Paroz 596cb9c7e2 Replaced print statement by print function (forward compatibility syntax). 2012-04-30 20:45:03 +02:00
Ramiro Morales e308cfc0e1 Added support for specifying initial values to model formsets and inline formsets.
This make them consistent with the similar capability of regular
formsets. Thanks to simon29 form the report and to Claude Paroz for the
patch.

Fixes #14574.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17373 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-15 01:36:14 +00:00
Alex Gaynor 749f0721c4 Fixed #16985 -- corrected a few grammar errors in the docs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16925 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-04 23:54:12 +00:00
Alex Gaynor d14bf8c62b Fixed #11404. Added ``FormSet.has_changed``, for consistancy with ``Form.has_changed``. Thanks to michelts for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16773 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-10 02:42:05 +00:00
Alex Gaynor 01b0eb50fd Make ``Formset.__getitem__`` O(1), rather than O(n). If you override ``__iter__`` you now need to also override ``__getitem__`` for consistant behavior. Thanks to Carl and Russ for the review.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16770 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-10 01:53:56 +00:00
Gabriel Hurley bdd1409eea Fixed #16467 -- Restored a previously correct example which was broken in [16564]. Thanks to dmclain for pointing out that the original example was correct.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16623 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-18 21:47:04 +00:00
Jannis Leidel 8ac23178ad Fixed #16467 -- Corrected formset code example. Thanks, teraom.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16564 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-29 09:40:22 +00:00
Jannis Leidel 1dfa567a23 Fixed typos introduced in r16430 and r16431. Thanks, magopian.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16433 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-18 08:48:25 +00:00
Jannis Leidel 2a122be0fc Fixed #16126 -- Added documentation about DELETE and ORDER fields in formsets. Many thanks to Aleksandra Sendecka.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16430 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-17 15:39:28 +00:00
Ramiro Morales 413ceb57b2 Changed 'raise' statements to new style syntax in documentation. Thanks DaNmarner. Refs #15635.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15874 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-17 20:49:31 +00:00
Timo Graham 2ea93f9327 Fixed #14000 - remove versionadded/changed tags for Django 1.0 and 1.1
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15055 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-26 00:37:14 +00:00
Russell Keith-Magee 877963f541 Corrected a markup error introduced in r14986.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14988 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-19 15:01:12 +00:00
Russell Keith-Magee 7adffaeaf6 Fixed #14655 -- Made formsets iterable. This allows a slightly more natural iteration API (`for form in formsets`), and allows you to easily override the form rendering order. Thanks to Kent Hauser for the suggestion and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14986 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-19 13:41:43 +00:00
Alex Gaynor 68548c3eff Fixed #14897 -- fixed some synax highlighting in the formset documentation. Thanks to marcusf for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14912 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-13 19:37:18 +00:00
Honza Král 65b380e74a Fixed #11418 -- formset.cleaned_data no longer raises AttributeError when is_valid is True. Thanks mlavin!
This also introduces a slightly backwards-incompatible change in
FormSet's behavior, see the release docs for details.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14667 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-21 17:27:01 +00:00
Jacob Kaplan-Moss 728effcfbd Fixed #14141: docs now use the :doc: construct for links between documents.
Thanks, Ramiro Morales.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13608 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-19 19:27:44 +00:00
Russell Keith-Magee d0d3e6792d Fixed #13524 -- Added backwards compatibility and feature notes regarding admin inlines and formsets. Thanks to Ramiro Morales and Gabriel Hurley.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13241 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-12 11:56:42 +00:00
Russell Keith-Magee 101571b940 Fixed #11908 -- Clarified the role and usage of the ManagementForm in formsets. Thanks to timo for the draft patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13222 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-10 14:07:05 +00:00
Russell Keith-Magee a44b10dba7 Fixed #12505 -- Clarified the use of the extra argument in formsets. Thanks to Andreas for the report, and timo for the draft patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13218 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-10 14:03:11 +00:00
Jannis Leidel aba95dcc0b Fixed #13023 - Removed ambiguity with regard to the max_num option of formsets and as a result of admin inlines. Thanks to Gabriel Hurley for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12872 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-27 23:03:56 +00:00
Jannis Leidel a0bae6ebb8 Updated formset docs to contain the new management form field for max_num values.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12373 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-01 14:19:30 +00:00
Jannis Leidel c14937cf7a Fixed #12508 - Added ability to dynamically add inlines in the admin app.
Refs #13. Also introduces an ``empty_form`` attribute on formsets to make it easier to implement dynamic forms.

Many thanks to Zain Memon for the initial patch from his Summer of Code 2009 project, Stanislaus Madueke for his django-dynamic-formset app and all the other people helping out.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12297 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-26 15:02:53 +00:00
Adrian Holovaty 9e3dbc7573 Fixed #10989 -- Fixed typos in formset and widget-media docs. Thanks, falken@mixworx.net and ramiro
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12168 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-10 17:45:55 +00:00
Luke Plant 48edb177ed Fixed #12053 - form examples don't validate according to w3c
Thanks to skyl for the report.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@12086 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-04 21:55:52 +00:00
Russell Keith-Magee b1e645b6cd Fixed #10287 -- Added better examples in the docs of formset validation. Thanks to Andrew Badr for the text.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11234 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-15 13:52:39 +00:00
Jacob Kaplan-Moss fc458dd710 Fixed #10795: added a link to model formsets docs from the formsets docs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10774 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-14 02:13:08 +00:00
Jacob Kaplan-Moss c6c25adf6d Fixed a whole bunch of small docs typos, errors, and ommissions.
Fixes #8358, #8396, #8724, #9043, #9128, #9247, #9267, #9267, #9375, #9409, #9414, #9416, #9446, #9454, #9464, #9503, #9518, #9533, #9657, #9658, #9683, #9733, #9771, #9835, #9836, #9837, #9897, #9906, #9912, #9945, #9986, #9992, #10055, #10084, #10091, #10145, #10245, #10257, #10309, #10358, #10359, #10424, #10426, #10508, #10531, #10551, #10635, #10637, #10656, #10658, #10690, #10699, #19528.

Thanks to all the respective authors of those tickets.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10371 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-03 18:30:54 +00:00
Joseph Kocherhans 9face54bb7 Fixed #9284. Fixed #8813. BaseModelFormSet now calls ModelForm.save().
This is backwards-incompatible if you were doing things to 'initial' in BaseModelFormSet.__init__, or if you relied on the internal _total_form_count or _initial_form_count attributes of BaseFormSet. Those attributes are now public methods.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10190 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30 15:58:52 +00:00
Gary Wilson Jr c565352954 Fixed #9780 -- Fixed an undefined internal link in the model forms documentation, thanks ramiro.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9670 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-23 00:01:09 +00:00
Malcolm Tredinnick 26fabdb218 Fixed #9531 -- Fixed some awkward wording in the docs. Thanks, gsf.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9434 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-14 08:01:01 +00:00
Adrian Holovaty 74f386dba2 Fixed #8979 -- Made a bunch of typo/formatting fixes to the docs. Thanks, ramiro
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8987 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-09 01:54:20 +00:00
Brian Rosner e704559e56 Fixed #8435 -- Documented the `prefix` option on formsets.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8631 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 16:44:52 +00:00
Jacob Kaplan-Moss 97cb07c3a1 Massive reorganization of the docs. See the new docs online at http://docs.djangoproject.com/.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8506 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 22:25:40 +00:00