summaryrefslogtreecommitdiff
path: root/django/forms
AgeCommit message (Collapse)Author
2013-05-26Replaced `and...or...` constructs with PEP 308 conditional expressions.Ramiro Morales
2013-05-25Fixed #11725 -- Made possible to create widget label tag without "for"Claude Paroz
Thanks Denis Martinez for the report and initial patch, and Sergey Kolosov for bringing the patch up to date.
2013-05-23Made fix for #9321 less buggy and more effective.Ramiro Morales
Don't try to be smart about building a good-looking help string because it evaluates translations too early, simply use the same old strategy as before. Thanks Donald Stufft for the report. Also, actually fix the case reported by the OP by special-casing CheckboxSelectMultiple. Added tests. Refs #9321.
2013-05-22Fixed #18709 -- Check if initial_value is a callableJeroen Dekkers
In _get_changed_data, check if initial_value is a callable and call it if it is.
2013-05-20Fixed #9321 -- Deprecated hard-coding of help text in model ManyToManyField ↵Ramiro Morales
fields. This is backward incompatible for custom form field/widgets that rely on the hard-coded 'Hold down "Control", or "Command" on a Mac, to select more than one.' sentence. Application that use standard model form fields and widgets aren't affected but need to start handling these help texts by themselves before Django 1.8. For more details, see the related release notes and deprecation timeline sections added with this commit.
2013-05-20Fixed #20403 -- Ignore forms marked for deletion when validating max_num.Ryan Kaskel
2013-05-19Merge pull request #1094 from senko/ticket_11160Andrew Godwin
Fixed #11160: Formset non_form_errors returns ErrorList() if is_valid is not called
2013-05-18Fixed #20440 -- Ensured CharField's max_length/min_length are integersTome Cvitan
2013-05-18Merge pull request #1113 from denibertovic/masterAymeric Augustin
Fixed #18761 -- Added whitespace stripping to URLField and SlugField.
2013-05-18Added stripping of whitespace for SlugField and URLFieldDeni Bertovic
2013-05-18Fixed argument order for localized_fields to ensure backwards compatibilityErik Romijn
2013-05-18Fixed #13546 -- Easier handling of localize field options in ModelFormErik Romijn
2013-05-18Fixed #11160 - Ensure full_clean is called from non_form_errorsSenko Rasic
Updated FormSet.non_form_errors() to ensure full_clean() has been called before returning the errors.
2013-05-17Replaced an antiquated pattern.Aymeric Augustin
Thanks Lennart Regebro for pointing it out.
2013-05-14Fixed #19934 - Use of Pillow is now preferred over PIL.Daniel Lindsley
This starts the deprecation period for PIL (support to end in 1.8).
2013-05-09Fixed #19733 - deprecated ModelForms without 'fields' or 'exclude', and ↵Luke Plant
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-04Used ngettext in a formsets error messageClaude Paroz
Several languages will distinctly translate '%d or fewer forms' depending on the variable.
2013-04-13Fixed #17840 -- Generalized named placeholders in form error messagesClaude Paroz
Also fixed plural messages for DecimalField.
2013-04-13Fixed #4592: Made CheckboxSelectMultiple more like RadioSelectBaptiste Mispelon
I refactored RadioSelect and CheckboxSelectMultiple to make them inherit from a base class, allowing them to share the behavior of being able to iterate over their subwidgets. Thanks to Matt McClanahan for the initial patch and to Claude Paroz for the review.
2013-04-13Fixed #4117: Apply id attribute to the outer <ul> of RadioSelectBaptiste Mispelon
2013-04-13Fixed #19874: Apply id attribute to the outer <ul> of CheckboxSelectMultipleBaptiste Mispelon
2013-04-12Fixed #20211: Document backwards-incompatible change in BoundField.label_tagBaptiste Mispelon
Also cleaned up label escaping and consolidated the test suite regarding label_tag.
2013-04-07Fix #15126: Better error message when passing invalid options to ModelForm.Meta.Baptiste Mispelon
2013-03-28Fixed spelling errorsGavin Wahl
2013-03-25Removed forced typecasting of help_text/label Field argumentsClaude Paroz
In any case, setting those variables to non-ascii utf-8 bytestrings is now considered a programming error.
2013-03-24Fixed #19385 again, now with real code changesAnssi Kääriäinen
The commit of 266de5f9ae9e9f2fbfaec3b7e4b5fb9941967801 included only tests, this time also code changes included...
2013-03-21Fixed #20084 -- Provided option to validate formset max_num on server.Andrew Gorcester
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-20Fixed #18839 - Field.__init__() now calls super().Carny Cheng
2013-03-19Fixed #18003 -- Preserved tracebacks when re-raising errors.konarkmodi
Thanks jrothenbuhler for draft patch, Konark Modi for updates.
2013-03-14Fixed #17051 -- Removed some 'invalid' field error messagesClaude Paroz
When the 'invalid' error message is set at field level, it masks the error message raised by the validator, if any.
2013-03-14Fixed #20039 -- Fixed has_changed form detection for required TypedChoiceFieldsClaude Paroz
Thanks Florian Apolloner for the report and the review. Also fixes #19643.
2013-03-08Fixed a regression in forms changed_dataClaude Paroz
Thanks Loic Bistuer for spotting the regression and the initial patch. Refs #16612.
2013-03-08Fixed #15363 -- Renamed and normalized to `get_queryset` the methods that ↵Loic Bistuer
return a QuerySet.
2013-03-07Fixed #19997 -- Added custom EMPTY_VALUES to form fieldsClaude Paroz
Thanks Loic Bistuer for the report and the patch.
2013-03-04Fixed #19464 -- Eased customization of ClearableFileInput's link markupClaude Paroz
Thanks rubyruy for the report and the patch.
2013-03-01Fixed #18898 -- Added tests with a fix for ModelMultipleChoiceFieldClaude Paroz
2013-03-01Fixed #16612 -- Improved has_changed detection for localized field valuesClaude Paroz
Thanks Simon Charette for the review.
2013-02-24Fixed #19908 -- Added missing import in forms.pyClaude Paroz
Thanks loic84 for the report.
2013-02-23Fixed #18829 -- Fixed ModelChoiceIterator lengthKlaas van Schelven
Thanks facundo.olano at gmail.com for the report and thikonom for the initial patch.
2013-02-23Fixed errors introduced in 21f333bcefccc151d6439246f8203d609ab6ca79. Refs #17751Florian Apolloner
2013-02-23Fixed #15877 -- Improved exception when ModelForm has no model classClaude Paroz
Thanks theaspect at gmail.com for the report and volrath for the patch.
2013-02-23Fix #17751: Added stripping of whitespace for ↵Erik Romijn
IPAddressField/GenericIPAddressField
2013-02-23Method "save" in BaseModelFormSet is marked as alters_dataKlaas van Schelven
Fixes #17663
2013-02-23Fixed #19686 -- Added HTML5 number input typeClaude Paroz
Thanks Simon Charette for his help on the patch. Refs #16630.
2013-02-19Added a default limit to the maximum number of forms in a formset.Aymeric Augustin
This is a security fix. Disclosure and advisory coming shortly.
2013-02-08Fixed #18906 -- Ignored to-be-deleted forms in formset validate_uniqueClaude Paroz
Thanks c.pollock at bangor.ac.uk for the report.
2013-02-05Fixed #17683 -- Make sure `BaseModelFormSet` respects defined widgets.Simon Charette
2013-01-30Merge pull request #686 from skrr/ticket_19703Claude Paroz
Fixed #19703 -- Typo in get_declared_fields docstring
2013-01-30Fixed #19034 -- Added proper i18n pluralization for max/min length ↵Claude Paroz
validation messages This was made possible by commit 3f1a0c0040b9. Thanks Evil Clay for the report and Alexey Boriskin his work on the ticket.
2013-01-30fixed minor typo #19703Simon Kerr