summaryrefslogtreecommitdiff
path: root/django/forms
AgeCommit message (Collapse)Author
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
2013-01-28Added HTML5 url input typeClaude Paroz
Refs #16630.
2013-01-28Added HTML5 email input typeClaude Paroz
Refs #16630.
2013-01-26Fixed #16123 -- Ensured strptime receive proper string typeClaude Paroz
strptime generates an UnicodeEncodeError when using a non-ascii unicode string on Python 2.
2013-01-26Fixed #18483 -- Marked hidden field error string for translationClaude Paroz
Thanks Evil Clay for the report and Emil Stenstrom for the initial patch.
2013-01-26Moved BooleanField 'required' validation in validate()Claude Paroz
2013-01-25Used property decorators in django/forms.pyClaude Paroz
2013-01-25Moved has_changed logic from widget to form fieldClaude Paroz
Refs #16612. Thanks Aymeric Augustin for the suggestion.
2013-01-24Fixed #17416 -- Added widgets argument to inlineformset_factory and ↵Nick Sandford
modelformset_factory
2013-01-18Avoided unnecessary recreation of RelatedObjectsAnssi Kääriäinen
Refs #19399. Thanks to Track alias KJ for the patch.
2013-01-15Removed obsolete comment.Aymeric Augustin
These features are implemented, tracked in tickets, or not necessary. Thanks Bruno Renié.
2013-01-11Fixed #10239 - Added docs for modelform_factoryTim Graham
Thanks ingenieroariel for the suggestion and slurms for the review.
2013-01-09Fixed #19581 -- ensure unique html ids with CheckboxSelectMultiple widgetsLoic Raucy
ID check is now done the same way as MultipleHiddenInput.
2013-01-03Fixed #19545 -- Make sure media/is_multipart work with empty formsetsSimon Charette
2013-01-01Removed unusable parameters to empty_form propertyClaude Paroz
2012-12-31Fixed #19537 -- Made CheckboxInput._has_changed handle 'False' stringClaude Paroz
Thanks dibrovsd@gmail.com for the report.
2012-12-28Fix #19524 -- Incorrect caching of parents of unsaved model instances.Aymeric Augustin
Thanks qcwxezdas for the report. Refs #13839.
2012-12-24Sort HTML attributes on generated formsIan Clelland
2012-12-19Fixed #18172 -- Made models with __iter__ usable in ModelMultipleChoiceFieldPatryk Zawadzki
Thanks to Patryk Zawadzki for the patch.
2012-12-06Fixed #18574 -- Make BaseFormSet.is_valid call its underlying forms' is_validAndreas Hug
Thanks Simon Charette for the report and the initial patch.
2012-11-05Fixed #8627 -- Prevented textareas to swallow first newline contentClaude Paroz
Browsers consider the first newline in textareas as some display artifact, not real content. Hence they are not sending it back to the server. If we want to keep initial newlines, we have to add one when we render the textarea. Thanks bastih for the report and initial patch.
2012-11-04Fixed #18949 -- Improve performance of model_to_dict with many-to-manyAnton I. Sipos
When calling model_to_dict, improve performance of the generated SQL by using values_list to determine primary keys of many to many objects. Add a specific test for this function, test_model_to_dict_many_to_many Thanks to brian for the original report and suggested fix.
2012-11-03Fixed #18963 -- Used a subclass-friendly patternAymeric Augustin
for Python 2 object model compatibility methods.
2012-10-26Fixed #16820 -- Treated '0' value as True for checkbox inputsClaude Paroz
Thanks Dan Fairs for the report and the initial patch.
2012-10-13Fixed #16479 - Forms generated from formsets use ErrorList instead of ↵Ludovic Delaveau
supplied error_class Patch with tests from charettes, updated.