diff options
| author | Marc Tamlyn <marc.tamlyn@gmail.com> | 2014-05-24 10:52:18 +0100 |
|---|---|---|
| committer | Marc Tamlyn <marc.tamlyn@gmail.com> | 2014-05-24 13:11:50 +0100 |
| commit | be733bf672eebb7d03061a293a2b0b03c727ab44 (patch) | |
| tree | c0d87ca6052d1affa96432dfcbbe1122fa5efddb /docs/releases | |
| parent | cdfefbec721b59695e28e5992eda1cc52af48212 (diff) | |
[1.7.x] Fixed #22510 -- Harden field removal to only None.
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
Diffstat (limited to 'docs/releases')
| -rw-r--r-- | docs/releases/1.7.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt index 44ccd022b6..4c01659ba6 100644 --- a/docs/releases/1.7.txt +++ b/docs/releases/1.7.txt @@ -544,8 +544,8 @@ Forms inheriting from both ``Form`` and ``ModelForm`` simultaneously have been removed as long as ``ModelForm`` appears first in the MRO. -* It's now possible to opt-out from a ``Form`` field declared in a parent class - by shadowing it with a non-``Field`` value. +* It's now possible to remove a field from a ``Form`` when subclassing by + setting the name to ``None``. * The new :meth:`~django.forms.Form.add_error()` method allows adding errors to specific form fields. |
