1
0
mirror of https://github.com/django/django.git synced 2025-03-15 03:40:44 +00:00

123 Commits

Author SHA1 Message Date
Tim Graham
20c03399d8 [1.11.x] Fixed #27998, #28543 -- Restored logging of ManyToManyField changes in admin's object history.
And prevented ManyToManyField initial data in model forms from being affected
by subsequent model changes.

Regression in 56a55566a791a11420fe96f745b7489e756fc931.

Partial backport of e5bd585c6eb1e13e2f8aac030b33c077b0b70c05 and
15b465c584f49a1d43b6c18796f83521ee4ffc22 from master
2017-08-31 09:41:04 -04:00
Srinivas Reddy Thatiparthy
a3b5df8ed5 [1.11.x] Fixed #28387 -- Fixed has_changed() for disabled form fields that subclass it.
Backport of 5debbdfcc84266703191e084914998e38f5f52eb from master
2017-07-14 13:27:30 -04:00
Jon Dufresne
8641489f4d [1.11.x] Fixed #28345 -- Applied limit_choices_to during ModelForm.__init__().
field_for_model() now has an additional keyword argument,
apply_limit_choices_to, allowing it to continue to be used to create
form fields dynamically after ModelForm.__init__() is called.

Thanks Tim Graham for the review.

Backport of a1be12fe193c8f3de8a0b0820f460a302472375f from master
2017-06-30 21:28:47 -04:00
Manatsawin Hanmongkolchai
110bd82038 [1.11.x] Fixed #28242 -- Moved ImageField file extension validation to the form field.
Backport of a0c07d77fc313388c72a17cd59411265069f037f from master
2017-06-01 10:44:47 -04:00
heathervm
ff0c6b83e5 [1.11.x] Fixed #27993 -- Fixed model form default fallback for SelectMultiple.
Backport of 7d1e23775344cc3dead03bd4af45f4fdf134b819 from master
2017-03-31 10:10:30 -04:00
James Beith
6963564ecc [1.11.x] Fixed #27975 -- Fixed crash if ModelChoiceField's queryset=None.
Regression in 9153d8fbd6385db9f48793662de789fc3d686841.

Backport of 216bb2e8fbc3cb37615bbd70edaa73287acdca81 from master
2017-03-22 08:57:02 -04:00
Mariusz Felisiak
17d75472f0 [1.11.x] Fixed nondeterministic ordering test failure in model_forms.
Backport of 2767ef3ca7 from master
2017-03-17 09:44:45 +02:00
Tim Graham
a95616944b [1.11.x] Refs #27563 -- Fixed ModelChoiceField.__deepcopy__() so forms don't share a queryset cache.
Thanks Luke Benstead for the report Simon Charettes for the fix.

Backport of 44f9241c48e28823b140bc4ec7515f5a88b88c32 from master
2017-03-15 12:55:05 -04:00
Jon Dufresne
52e9c1c8b7 [1.11.x] Fixed #27758 -- Reallowed AdvancedModelIterator pattern after template widget rendering.
Backport of 6d8979f4c2fbfb9fd5db92acd72489cbbcbdd5d1 from master
2017-01-31 09:43:31 -05:00
Josef Rousek
aaecf038ca Fixed #27370 -- Prevented Select widget from using 'required' with a non-empty first value. 2016-12-28 10:45:22 -05:00
Preston Timmons
b52c73008a Fixed #15667 -- Added template-based widget rendering.
Thanks Carl Meyer and Tim Graham for contributing to the patch.
2016-12-27 17:50:10 -05:00
Tim Graham
7ed456063b Updated LimitChoicesToTests to use setUpTestData and cosmetic edits. 2016-12-02 14:46:52 -05:00
Jon Dufresne
6abd6c598e Fixed #27563 -- Moved "apply limit_choices_to" code from BaseModelForm to fields_for_model(). 2016-12-02 08:40:24 -08:00
za
321e94fa41 Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings. 2016-11-10 21:30:21 -05:00
Michal Petrucha
09da1e79de Fixed #27369 -- Prevented widgets from being shared between form field instances. 2016-11-06 07:16:56 +01:00
Tim Graham
2f9861d823 Fixed #27148 -- Fixed ModelMultipleChoiceField crash with invalid UUID. 2016-10-31 15:21:05 -04:00
Tim Graham
87c5e7efeb Refs #27186 -- Fixed model form default fallback for CheckboxSelectMultiple. 2016-09-30 14:49:50 -04:00
Tim Graham
3507d4e773 Fixed #27186 -- Fixed model form default fallback for MultiWidget, FileInput, SplitDateTimeWidget, SelectDateWidget, and SplitArrayWidget.
Thanks Matt Westcott for the review.
2016-09-22 12:20:58 -04:00
Jon Dufresne
2c716c1dc7 Fixed #27256 -- Changed Select widget's selected attribute to use HTML5 boolean syntax. 2016-09-21 15:12:13 -07:00
Tim Graham
8119b679eb Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.
http://bugs.python.org/issue27364
2016-09-17 15:44:06 -04:00
Adam Chainz
652bcc6f5f Refs #25415 -- Fixed invalid models in the test suite. 2016-09-09 17:16:42 -04:00
Tim Graham
dab653cadc Organized forms_tests test_regressions.py. 2016-09-09 08:55:29 -04:00
Alex Hill
d9c083cfee Refs #27039 -- Fixed regression with field defaults in prefixed forms. 2016-09-01 09:13:21 -04:00
Tim Graham
4bc6b93994 Fixed #27039 -- Fixed empty data fallback to model field default in model forms. 2016-08-24 17:50:10 -04:00
Alex Hill
74105b2636 Fixed #27002 -- Prevented double query when rendering ModelChoiceField. 2016-08-08 13:41:05 -04:00
Alex Hill
c5ebfda002 Fixed #27001 -- Fixed a query count regression in ModelChoiceField with RadioSelect. 2016-08-03 10:45:55 -04:00
Tim Graham
4e86168290 Fixed #26970 -- Fixed crash with disabled ModelMultipleChoiceField. 2016-07-30 13:31:48 -04:00
Tim Graham
a5f85d891b Fixed #26917 -- Fixed crash in disabled ModelChoiceFields.
Partially reverted refs #25532 to fix a regression in Django 1.10.
This reintroduces a crash for disabled forms.JSONField (refs #26949),
however, that issue is also present on Django 1.9.

Thanks Ryan Schave for the test.
2016-07-27 08:14:14 -04:00
Andrey Fedoseev
81963b37a9 Fixed #17657 -- Made ModelForm respect ModelMultipleChoiceField's to_field_name.
Follow up to 67d984413c9540074e4fe6aa033081a35cf192bc.
2016-07-12 16:20:06 -04:00
Tim Graham
c9ae09addf Replaced use of TestCase.fail() with assertRaises().
Also removed try/except/fail antipattern that hides exceptions.
2016-06-28 11:21:26 -04:00
Tim Graham
26d0023ccc Refs #15667 -- Fixed crash when indexing RadioFieldRenderer with ModelChoiceIterator.
Regression in 86573861a95e5a47dc7ff906443117d75b73dca1
2016-06-18 10:33:37 -04:00
Jon Dufresne
4f336f6652 Fixed #26747 -- Used more specific assertions in the Django test suite. 2016-06-16 14:19:18 -04:00
Jon Dufresne
267dc4addd Fixed #4136 -- Made ModelForm save empty values for nullable CharFields as NULL.
Previously, empty values were saved as strings.
2016-06-13 09:14:36 -04:00
David Sanders
5ec64f96b2 Fixed #26734 -- Made iterator class configurable on ModelChoiceField. 2016-06-09 11:10:26 -04:00
Offby-One Kenobi
f2b2a35699 Fixed docstring typos. 2016-05-02 11:43:03 -04:00
Jon Dufresne
ec6121693f Fixed #22383 -- Added support for HTML5 required attribute on required form fields. 2016-04-21 19:16:38 -04:00
Tim Graham
92053acbb9 Fixed E128 flake8 warnings in tests/. 2016-04-08 10:12:33 -04:00
Yoong Kang Lim
d5f89ff6e8 Fixed #24974 -- Fixed inheritance of formfield_callback for modelform_factory forms. 2016-02-26 12:27:27 -05:00
Claude Paroz
d43156e1e9 Fixed #26238 -- Raised explicit error for non-editable field in ModelForm
Thanks Luke Crouch for the report and Simon Charette for the review.
2016-02-21 00:24:20 +01:00
haxoza
375e1cfe2b Fixed #25349 -- Allowed a ModelForm to unset a fields with blank=True, required=False. 2016-02-19 14:18:53 -05:00
Hasan
3d0dcd7f5a Refs #26022 -- Used context manager version of assertRaises in tests. 2016-01-29 12:32:18 -05:00
Tim Graham
6afa6818fc Fixed #25496 -- Made ModelChoiceField respect prefetch_related(). 2015-10-05 18:21:56 -04:00
Tim Graham
7cb3a48843 Fixed #25410 -- Fixed empty ClearableFileInput crash on Python 2.
Reverted "Fixes #24727 -- Prevented ClearableFileInput from masking
exceptions on Python 2" and added a regression test.

This reverts commit 5c412dd8a724b263489c1bd7a2fea381460665d7.
2015-09-23 10:26:19 -04:00
Dražen Odobašić
b1e33ceced Fixed #23395 -- Limited line lengths to 119 characters. 2015-09-12 11:40:50 -04:00
Keryn Knight
3c5862ccb0 Fixed #24706 -- Made ModelForm._post_clean() handle a ValidationError raised when constructing the model instance.
Thanks Loïc Bistuer for review and advice.
2015-09-07 14:36:39 -04:00
Tim Graham
f2b665f886 Fixed #25241 -- Corrected ModelForm.save() error message when saving invalid form with UUIDField pk. 2015-08-07 07:44:59 -04:00
Flavio Curella
c2e70f0265 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 2015-07-27 18:28:13 -04:00
Simon Charette
be67400b47 Refs #24652 -- Used SimpleTestCase where appropriate. 2015-05-20 13:46:13 -04:00
Bertrand Bordage
3e64f3d0fc Fixed #24531 -- Improved CommaSeparatedIntegerField validation.
`','`, `'1,,1'`, `',1'` etc. are no longer considered as valid
comma-separated integer lists.
2015-03-25 18:49:59 -04:00
Claude Paroz
b4a1bb8669 Updated test to be date-independent
Fixes commit 8714403614.
2015-03-05 10:08:39 +01:00