Commit Graph

83 Commits

Author SHA1 Message Date
leandrafinger 08b501e7d3 add missing imports to the examples in the 'Forms' 2013-05-19 13:31:45 +02: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
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
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
Alex Hunley 976dc07baf Removed a misleading examples from documentations ala ticket #19719 2013-02-16 14:30:55 -05: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
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
Claude Paroz 8248d14029 Removed US localflavor-specific tests from core
Also fixes #9045.
2012-12-08 21:07:59 +01:00
Tim Graham d3fd8a1512 Fixed #15591 - Clarified interaction between ModelForm and model validation. 2012-11-05 18:24:28 -05:00
Tim Graham fd02bcff4a Fixed #18548 - Clarified note regarding reusing model instances when form validation fails. 2012-10-16 20:39:13 -04:00
Nick Martini 571698997f fixing modelforms example code, ticket #18832 2012-09-08 12:30:41 -04:00
Tim Graham 3fd89d9903 Fixed #14885 - Clarified that ModelForm cleaning may not fully complete if the form is invalid.
Thanks Ben Sturmfels for the patch.
2012-08-21 17:32:53 -04:00
Tim Graham ebbc414d17 Fixed #16168 - Added note regarding type requirements when overridng ModelForm fields.
Thanks Pieter Swinkels for the patch.
2012-08-01 07:59:28 -04:00
Claude Paroz 19a810b18c Fixed #14917 -- Hinted that view should redirect after form post success 2012-06-23 18:47:52 +02:00
Aymeric Augustin 33999d9871 Fixed #18445 -- Added a links in the docs.
Thanks Audrey Roy for the patch.
2012-06-07 22:11:24 +02: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 596cb9c7e2 Replaced print statement by print function (forward compatibility syntax). 2012-04-30 20:45:03 +02:00
Aymeric Augustin 9ed6e08ff9 Removed deprecated URLField.verify_exists.
The deprecation schedule was slightly accelerated because of possible security ramifications.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@17847 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-03-31 13:55:03 +00:00
Adrian Holovaty 6ecadcbdd2 Made a bunch more edits up until [17418]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17428 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-03 20:45:45 +00: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
Luke Plant d1e5c55258 Fixed many more ReST indentation errors, somehow accidentally missed from [16955]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16983 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-14 00:12:01 +00:00
Paul McMillan 4f109fcbff Fixed 11674 -- Clarified docs on excluded fields of ModelForms.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16875 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-22 04:52:43 +00:00
Jannis Leidel 566b3295fa Fixed #16621 -- Fixed lots of typos in the docs. Thanks, Bernhard Essl.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16615 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-13 11:58:19 +00:00
Timo Graham 0350d65fa4 Fixed #16513 - Add forms import to example; thanks teraom.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16586 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-06 19:02:20 +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
Jannis Leidel ce3c281090 Fixed #811 -- Added support for IPv6 to forms and model fields. Many thanks to Erik Romijn.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16366 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-11 13:48:24 +00:00
Timo Graham fc508fd5d2 Fixed #15990 - Simplified a sentence regarding form validation for ModelForms; thanks jblaine for the suggestion.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16329 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-04 21:42:53 +00:00
Russell Keith-Magee d1290b5b43 Fixed #3094 -- Accelerated deprecation of XMLField, since it hasn't served any useful purpose since oldforms. Thanks to PaulM for driving the issue and providing the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15723 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-03 13:28:20 +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 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
Timo Graham 22d4ecb19b Fixed #14791 - Clarify additional note on save(). Thanks OldTroll.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14740 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-28 18:48:55 +00:00
Gabriel Hurley d371142001 Fixed #14537 -- Added documentation on where validators can be imported from to Validators Reference docs, and improved Sphinx formatting and metadata. Thanks to rfugger for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14331 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-23 22:06:01 +00:00
Gabriel Hurley 548b6c7e69 Fixed #14392 -- Changed ModelForm.fields and ModelForm.exclude examples to use tuples instead of lists since they were used inconsistently throughout the page (it wasn't hurting anything, but consistency is nice). Thanks to lspcity for the report and gruszczy for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14134 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-10 22:40:54 +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 50e3aa03e6 Fixed #11735 -- Corrected an example of FormSet subclassing. Thanks to claudep for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13553 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-07 14:56:38 +00:00
Russell Keith-Magee 10b5f38593 Fixed #13551 -- Corrected import in ModelForms example. Thanks to libber for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13269 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-17 00:27:37 +00:00
Karen Tracey 8e7d2d2e68 Fixed #13530: Corrected a handful of doc typos. Thanks Ramiro.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13247 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-12 22:53:23 +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 e34ca2b1e2 Fixed #13269 -- Added clarifying import statement to widget override docs. Thanks to mattrowbum for the report, and Gabriel Hurley for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13130 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-08 07:32:31 +00:00
Russell Keith-Magee ee6d5521e9 Fixed #12691 -- Added a versionadded tag to the description of widget overrides in forms. Thanks to danielr for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13108 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-06 01:19:45 +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
Joseph Kocherhans fa6c967438 Fixed #12896. Documented the new side-effects of ModelForm validation.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12693 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-06 19:51:29 +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
Joseph Kocherhans 2f9853b2dc Fixed #12512. Changed ModelForm to stop performing model validation on fields that are not part of the form. Thanks, Honza Kral and Ivan Sagalaev.
This reverts some admin and test changes from [12098] and also fixes #12507, #12520, #12552 and #12553.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12206 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-12 02:29:45 +00:00
Adrian Holovaty 9bb1fa7251 Fixed #9223 -- Added support for declarative widgets to ModelForm. I declare thanks to isagalaev.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12194 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-10 19:23:42 +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