summaryrefslogtreecommitdiff
path: root/django/forms
AgeCommit message (Collapse)Author
2013-09-21[1.6.x] Ensured that BoundField.as_widget always returns properly localized ↵Florian Apolloner
fields. This is a follow-up to #18777 which improperly converted to strings in prepare_value and as such caused regressions like #21074. Refs #18777, #21074 Backport of 56743cf9e337826e4c615909570bb057142a6a7b from master.
2013-09-10[1.6.x] Took advantage of django.utils.six.moves.urllib.*.Aymeric Augustin
Backport of 6a6428a36 from master.
2013-08-22[1.6.x] Moved translator comment just above the target stringClaude Paroz
Backport of 8cd874298 from master.
2013-08-05[1.6.x] Fixed #20850 -- Added MultiWidget.needs_multipart_formTim Heap
Backport of 75c87e2d38 from master
2013-08-02[1.6.x] Fixed #18777 -- Localized form fields with as_text/as_hiddenAleksandra Sendecka
Thanks croldan for the report. Backport of 893d8de6f5 from master
2013-07-26[1.6.x] Fixed #20805 -- Removed an extra colon beside checkboxes in the admin.Tim Graham
Thanks CollinAnderson for the report. Backport of 8676318d2d from master
2013-07-22[1.6.x] Fixed #20781 -- Fixed _has_changed regression with MultiValueFieldClaude Paroz
Thanks Tim Graham for the report. Backport of 02b0106d from master.
2013-07-19[1.6.x] Fixed #20765 -- Set small values of `step` using exponential notation.Simon Charette
Browsers parse small factors of 10 as 0 under decimal notation. Thanks to Trac alias matklad for the report and Claude Paroz for the review. Backport of 415a36947c from master.
2013-07-13[1.6.x] Fixed #20582 -- Allowed default Form.label_suffix to be translatedClaude Paroz
Thanks Tim Graham for the review. Backport of 7557207983 from master.
2013-06-22Fixed 17478 -- Allowed queryset overriding in BaseModelFormSet initClaude Paroz
BaseModelFormSet.forms is now a cached property instead of being populated in the __init__ method. This behaviour also matches an example in the documentation. Thanks Thomasz Swiderski for the report and Simon Charette for the review.
2013-06-20Fixed #20630 -- Removed `maxlength` attribute from `NumberInput`.Simon Charette
This attribute is only allowed on inputs of type "text", "search", "url", "tel", "email", or "password". Thanks to yoyoma for the report and @bmispelon for the review.
2013-06-19Removed several unused imports.Aymeric Augustin
2013-06-18Fixed #20618 -- Fixed regression in `BoundField.label_tag`.Baptiste Mispelon
2013-06-18Fixed #20199 -- Allow ModelForm fields to override error_messages from model ↵Loic Bistuer
fields
2013-06-18Refactored ValidationError to allow persisting error params and error codes ↵Loic Bistuer
as the exception bubbles up
2013-06-16Fixed #20464 -- Added a `total_error_count` method on formsets.Baptiste Mispelon
Thanks to frog32 for the report and to Tim Graham for the review.
2013-06-13Fixed #20000 -- Allowed ModelForm meta overrides for label, help_text and ↵Loic Bistuer
error_messages
2013-06-13Fixed #20594 -- Add validation to models.SlugField.Baptiste Mispelon
Thanks carbonXT for the report.
2013-06-10Fixed #18134 -- BoundField.label_tag now includes the form's label_suffixGabe Jackson
There was an inconsistency between how the label_tag for forms were generated depending on which method was used: as_p, as_ul and as_table contained code to append the label_suffix where as label_tag called on a form field directly did NOT append the label_suffix. The code for appending the label_suffix has been moved in to the label_tag code of the field and the HTML generation code for as_p, as_ul and as_table now calls this code as well. This is a backwards incompatible change because users who have added the label_suffix manually in their templates may now get double label_suffix characters in their forms.
2013-06-06Fixed #12337 - Honor ModelForm.Meta.exclude when saving ManyToManyFields.Stephen Burrows
Thanks margieroginski for the report.
2013-05-30Added missing stacklevel arg in forms/models.pyClaude Paroz
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.