| Age | Commit message (Collapse) | Author |
|
Refs #22950.
Backport of 920904921 from master.
|
|
Refs #8620.
If we allow any value to remove form fields then we get name clashes
with method names, media classes etc. There was a backwards
incompatibility introduced meaning ModelForm subclasses with declared
fields called media or clean would lose those fields.
Field removal is now only permitted by using the sentinel value None.
The docs have been slightly reworded to refer to removal of fields
rather than shadowing.
Thanks to gcbirzan for the report and initial patch, and several of the
core team for opinions.
Backport of 9fb0f5dddc4cf7f2d294af1bcde2c359cffd90a5 from master
|
|
Made explicit lack of microsecond handling by built-in datetime form
fields. Used that explicitness to appropriately nix microsecond
values in bound fields. Thanks Claude Paroz for the review.
Backport of a5de0df58 from master.
|
|
Backport of df60db0e78 from master
|
|
Thanks Anssi Kääriäinen for the idea and Simon Charette for the
review.
|
|
Thanks Piotr Kasprzyk for help with the patch.
|
|
Overriding the error messages now works for both unique fields, unique_together
and unique_for_date.
This patch changed the overriding logic to allow customizing NON_FIELD_ERRORS
since previously only fields' errors were customizable.
Refs #20199.
Thanks leahculver for the suggestion.
|
|
|
|
|
|
Refs #20199 #16986.
Thanks @akaariai, @bmispelon, @mjtamlyn, @timgraham for the reviews.
|
|
|
|
|
|
|
|
many occurrences in the tests/ dir so it can't be removed from setup.cfg yet)
|
|
shadowing them.
|
|
scenarios.
Thanks apollo13, funkybob and mjtamlyn for the reviews.
|
|
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
|
|
Thanks PaulM for the suggestion and Luke Granger-Brown and
Wiktor Kołodziej for the initial patch.
|
|
Thanks SmileyChris for the suggestion.
|
|
|
|
In `BoundField.__iter__`, the widget's id attribute is now passed to
each subwidget. A new id_for_label property was added to ChoiceInput.
|
|
This means it doesn't break for people who are doing
`cleaned_data = super(FooForm, self).clean()`.
|
|
If it does, that will be used as the cleaned_data. The default
implementation has been changed to match this change.
|
|
Thanks Loic Bistuer for the review.
|
|
Should be unneeded with Python 2.7 and up.
Added some unicode_literals along the way.
|
|
Thanks CollinAnderson for the report.
|
|
Thanks Tim Graham for the review.
|
|
|
|
|
|
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.
|
|
|
|
Thanks Denis Martinez for the report and initial patch, and
Sergey Kolosov for bringing the patch up to date.
|
|
In _get_changed_data, check if initial_value is a callable and call it
if it is.
|
|
Thanks Lennart Regebro for pointing it out.
|
|
Also cleaned up label escaping and consolidated the test suite regarding
label_tag.
|
|
Thanks Loic Bistuer for spotting the regression and the initial
patch. Refs #16612.
|
|
Thanks Simon Charette for the review.
|
|
Thanks loic84 for the report.
|
|
|
|
Thanks Evil Clay for the report and Emil Stenstrom for the initial
patch.
|
|
|
|
Refs #16612. Thanks Aymeric Augustin for the suggestion.
|
|
* Renamed the __unicode__ methods
* Applied the python_2_unicode_compatible decorator
* Removed the StrAndUnicode mix-in that is superseded by
python_2_unicode_compatible
* Kept the __unicode__ methods in classes that specifically
test it under Python 2
|
|
* Renamed smart_unicode to smart_text (but kept the old name under
Python 2 for backwards compatibility).
* Renamed smart_str to smart_bytes.
* Re-introduced smart_str as an alias for smart_text under Python 3
and smart_bytes under Python 2 (which is backwards compatible).
Thus smart_str always returns a str objects.
* Used the new smart_str in a few places where both Python 2 and 3
want a str.
|
|
|
|
cleaned_data is no longer deleted when form validation fails but only
contains the data that did validate.
Thanks to the various contributors to this patch (see ticket).
|
|
|
|
|
|
Thanks to anonymous/AeroNotix for the report
|
|
|