mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Fixed #17673 -- Forbid field shadowing.
Thanks Anssi Kääriäinen for the suggestion.
This commit is contained in:
parent
f5123c7291
commit
ee9fcb1672
6 changed files with 223 additions and 65 deletions
|
@ -1068,6 +1068,12 @@ Miscellaneous
|
|||
which does allow primary keys with value 0. It only forbids *autoincrement*
|
||||
primary keys with value 0.
|
||||
|
||||
* Shadowing model fields defined in a parent model has been forbidden as this
|
||||
creates amiguity in the expected model behavior. In addition, any clashing
|
||||
fields in the model inheritance hierarchy results in a system check error.
|
||||
For example, if you use multi-inheritance, you need to define custom primary
|
||||
key fields on parent models, otherwise the default ``id`` fields will clash.
|
||||
|
||||
.. _deprecated-features-1.7:
|
||||
|
||||
Features deprecated in 1.7
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue